How to add cpufeatures to android jni cmake gradle build?

后端 未结 1 820
北荒
北荒 2021-01-14 09:30

If I have a build.gradle for an application:

android {
    compileSdkVersion 24
    buildToolsVersion \"25.0.2\"
    defaultConfig {
        applicationId \"         


        
1条回答
  •  说谎
    说谎 (楼主)
    2021-01-14 10:09

    Do you have to add this to build.gradle specifically? If not, add the following to one of your CMakeLists.txt files:

    include(AndroidNdkModules)
    android_ndk_import_module_cpufeatures()
    

    Then you can target_link_libraries(, cpufeatures). That macro and a couple of others are defined in $ANDROID_SDK/cmake//share/cmake-/Modules/AndroidNdkModules.cmake.

    0 讨论(0)
提交回复
热议问题