How to add cpufeatures to android jni cmake gradle build?

后端 未结 1 821
北荒
北荒 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(<your target>, cpufeatures). That macro and a couple of others are defined in $ANDROID_SDK/cmake/<cmake-version>/share/cmake-<version>/Modules/AndroidNdkModules.cmake.

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