Turn on compiler optimization for Android Studio debug build via Cmake -
i using android studio 3.0 ndk based app. c++ code, use cmake external builder.
this works well, can create debug , release binaries.
however, turn on compiler optimizations (say -o3) part of c++ code (the physics engine), not release build, debug build.
so create bulk of debug build is, without optimizing, yet, want 1 of static library targets built compiler optimization enabled.
how can go this?
i have cmakelists static library target gets included using add_subdirectory() directive in top level cmakelists file.
note point top level cmakelists in app's build.gradle file this:
externalnativebuild { cmake { path '../../android/jni/cmakelists.txt' } }
it turns out can use target_compile_options() macro in cmakelists.txt config specification this:
target_compile_options(opende private "$<$<config:release>:-o3>" "$<$<config:debug>:-o3>" )
this macro adds existing compile options.
Comments
Post a Comment