Set build flags automatically