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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -