DSL object for per-variant CMake configurations.
Property | Description |
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
|
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. |
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.
Per-variant arguments for CMake.
For example:
arguments "-DCMAKE_VERBOSE_MAKEFILE=TRUE"
For a list of properties you can configure, see CMake Variables List.
Per-variant flags for the C compiler.
For example:
cFlags "-D_EXAMPLE_C_FLAG1", "-D_EXAMPLE_C_FLAG2"
Per-variant flags for the C++ compiler.
For example:
cppFlags "-D__STDC_FORMAT_MACROS"
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.