如果我有一个应用程序的build.gradle:
android { compileSdkVersion 24 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.ndkcmaketest.headwayent.ndkcmaketest" minSdkVersion 19 targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { cppFlags "-frtti -fexceptions" arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=gcc"//, "-DANDROID_ALLOW_UNDEFINED_SYMBOLS=TRUE" } } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } externalNativeBuild { cmake { path "CMakeLists.txt" } } }
如何将cpufeatures添加为ldlibs?在externalNativeBuild中添加ldLibs.addAll(["cpufeatures"])不起作用.并且都没有添加ndk块.
你必须build.gradle
专门添加这个吗?如果没有,请将以下内容添加到您的某个CMakeLists.txt
文件中:
include(AndroidNdkModules) android_ndk_import_module_cpufeatures()
那你就可以target_link_libraries(
.该宏和其他几个定义在$ANDROID_SDK/cmake/
.