ExternalNativeBuild

Added in 4.2.0

interface ExternalNativeBuild


DSL object to configure external native builds using CMake or ndk-build

android {
externalNativeBuild {
// Encapsulates your CMake build configurations.
// For ndk-build, instead use the ndkBuild block.
cmake {
// Specifies a path to your CMake build script that's
// relative to the build.gradle file.
path "CMakeLists.txt"
}
}
}

To learn more about including external native builds to your Android Studio projects, read Add C and C++ Code to Your Project

Summary

Public functions

Unit
cmake(action: Cmake.() -> Unit)

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

Unit
ndkBuild(action: NdkBuild.() -> Unit)

Per module settings, such as the path to Android.mk, for an external ndk-build project.

Public properties

Cmake

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

MutableMap<StringAny>

Additional per module experimental properties for C and C++.

NdkBuild

Per module settings, such as the path to Android.mk, for an external ndk-build project.

Public functions

cmake

Added in 4.2.0
fun cmake(action: Cmake.() -> Unit): Unit

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

For more information about the properties you can configure in this block, see Cmake.

ndkBuild

Added in 4.2.0
fun ndkBuild(action: NdkBuild.() -> Unit): Unit

Per module settings, such as the path to Android.mk, for an external ndk-build project.

For more information about the properties you can configure in this block, see NdkBuild.

Public properties

cmake

Added in 4.2.0
val cmakeCmake

Per module settings, such as the path to CMakeLists.txt, for an external CMake project.

For more information about the properties you can configure in this block, see Cmake.

experimentalProperties

Added in 7.3.0
val experimentalPropertiesMutableMap<StringAny>

Additional per module experimental properties for C and C++.

ndkBuild

Added in 4.2.0
val ndkBuildNdkBuild

Per module settings, such as the path to Android.mk, for an external ndk-build project.

For more information about the properties you can configure in this block, see NdkBuild.