ExternalNativeNdkBuildOptions

DSL object for per-variant ndk-build configurations.

Properties

PropertyDescription
abiFilters

Per-variant ABIs Gradle should build, independently of the ones it packages into your APK. In most cases, you only need to specify your desired ABIs using NdkOptions.abiFilter(), which controls which ABIs Gradle builds and packages into your APK.

arguments

Per-variant arguments for ndk-build settings also available to your Android.mk and Application.mk scripts.

cFlags

Per-variant flags for the C compiler.

cppFlags

Per-variant flags for the C++ compiler.

targets

Per-variant target libraries from your ndk-build project that Gradle should build and package into your APK.

Methods

No methods

Script blocks

No script blocks

Property details

Set<String> abiFilters

Per-variant ABIs Gradle should build, independently of the ones it packages into your APK. In most cases, you only need to specify your desired ABIs using NdkOptions.abiFilter(), which controls which ABIs Gradle builds and packages into your APK.

List<String> arguments

Per-variant arguments for ndk-build settings also available to your Android.mk and Application.mk scripts.

For example:

arguments "NDK_APPLICATION_MK:=Application.mk"

List<String> cFlags

Per-variant flags for the C compiler.

For example:

cFlags "-D_EXAMPLE_C_FLAG1", "-D_EXAMPLE_C_FLAG2"

List<String> cppFlags

Per-variant flags for the C++ compiler.

For example:

cppFlags "-DTEST_CPP_FLAG1", "-DTEST_CPP_FLAG2"

Set<String> targets

Per-variant target libraries from your ndk-build project that Gradle should build and package into your APK.

For example, if your ndk-build project defines two libraries, libexample-one.so and libexample-two.so, you can tell Gradle to only build and package libexample-one.so with the following:

targets "example-one"

When this property is not configured, Gradle builds and packages all available shared object targets.