use most optimized way in default build and generate lib