ExternalNativeCmakeOptions

DSL object for per-variant CMake 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, which controls which ABIs Gradle builds and packages into your APK.

arguments

Per-variant arguments for CMake.

cFlags

Per-variant flags for the C compiler.

cppFlags

Per-variant flags for the C++ compiler.

targets

Per-variant target libraries from your CMake 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, which controls which ABIs Gradle builds and packages into your APK.

List<String> arguments

Per-variant arguments for CMake.

For example:

arguments "-DCMAKE_VERBOSE_MAKEFILE=TRUE"

For a list of properties you can configure, see CMake Variables List.

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 "-D__STDC_FORMAT_MACROS"

Set<String> targets

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

For example, if your CMake project defines two libraries, libexample-one.so and libexample-two.so, you can tell Gradle to only build and package libexample-one.so as follows:

targets "example-one"

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