Skip to content

Commit

Permalink
Update to NDK r26 (closes #936)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Nov 18, 2023
1 parent 6f0dd1b commit d68c36c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions product/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ add_compile_options(-DNDEBUG)
# This warning appears on Python 3.8 only (https://github.com/python/cpython/pull/14193).
add_compile_options(-Wno-deprecated-declarations)

# The Android Gradle plugin may strip libraries before building them into an app, but
# we don't want to require the app developer to have the NDK installed.
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -s")

include_directories(
Expand Down
12 changes: 10 additions & 2 deletions product/runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,18 @@ def proxyTask = tasks.register("generateStaticProxy", Exec) {
}
sourceSets.test.java.srcDir(proxyTask)

// CMakeLists.txt may contain configuration-specific settings, so make sure we only use
// one of the known configurations.
String cmakeBuildType = findProperty("cmakeBuildType") ?: "Debug"
def KNOWN_BUILD_TYPES = ["Debug", "Release"]
if (!(cmakeBuildType in KNOWN_BUILD_TYPES)) {
throw new GradleException(
"Unknown build type '$cmakeBuildType'; valid values are $KNOWN_BUILD_TYPES")
}

(["host"] + Common.ABIS).each { abi ->
def pyLibSuffix = ".so"
def cmakeBuildSubdir = "$buildDir/cmake/$abi"
def cmakeBuildType = findProperty("cmakeBuildType") ?: "Debug"
def cmake = tasks.register("cmake-$abi", Exec) {
group = "build"
dependsOn("cythonPython", "cythonJava")
Expand Down Expand Up @@ -264,7 +272,7 @@ sourceSets.test.java.srcDir(proxyTask)
// This must be one of the NDK versions which are pre-installed on the
// GitHub Actions runner. Ideally it would also match the version in
// target/build-common.sh, but the latter is more difficult to change.
def ndkDir = sdkPath("ndk/23.2.8568313")
def ndkDir = sdkPath("ndk/26.1.10909125")
def prefixDir = "$projectDir/../../target/prefix/$abi"
args "-DCMAKE_TOOLCHAIN_FILE=$ndkDir/build/cmake/android.toolchain.cmake",
"-DANDROID_ABI=$abi", "-DANDROID_STL=system",
Expand Down

0 comments on commit d68c36c

Please sign in to comment.