最終更新:2016-10-03 (月) 15:25:37 (2060d)  

externalNativeBuild
Top / externalNativeBuild

メモ

CMake

  • android {
        externalNativeBuild {
            cmake {
                path "CMakeLists.txt"
            }
        }
    }

フラグの追加

  • android {
        defaultConfig {
            externalNativeBuild {
                cmake {
                    cppFlags "-frtti -fexceptions"
                }
            }
        }
  • android {
        defaultConfig {
            externalNativeBuild {
                cmake {
                    targets "target1", "target2"
                    arguments "-DANDROID_TOOLCHAIN=clang"
                    cFlags "-DTEST_C_FLAG1", "-DTEST_C_FLAG2"
                    cppFlags "-DTEST_CPP_FLAG2", "-DTEST_CPP_FLAG2"
                    abiFilters "armeabi-v7a", "armeabi"
                } 
            }
        }
    }

ndk-build

  • externalNativeBuild{
       ndkBuild{
            path "Android.mk"
        }
    }
    
    defaultConfig {
      externalNativeBuild {
        ndkBuild {
          targets "target1", "target2"
          arguments "NDK_APPLICATION_MK:=Application.mk"
          cFlags "-DTEST_C_FLAG1", "-DTEST_C_FLAG2"
          cppFlags "-DTEST_CPP_FLAG2", "-DTEST_CPP_FLAG2"
          abiFilters "armeabi-v7a", "armeabi"
        } 
      }
    }

参考