summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-02 00:52:20 +0800
committerGitHub <[email protected]>2024-04-02 00:52:20 +0800
commita86468f8c55a3ef487529c84dcee435c67b20e95 (patch)
tree24360581caeabddda6b0e858038e995bbf164832
parent6e061abc8d3a1154001708e85ff50d76ff21f6f7 (diff)
parent81a2155257aa0cba6a560cbc3b0f226dba5c6280 (diff)
Merge pull request #4917 from SirLynix/patch-15
package.tools.cmake: Use newer Android toolchain and support runtimes
-rw-r--r--xmake/modules/package/tools/cmake.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index a566e4cb6..2a0a4d006 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -419,15 +419,17 @@ function _get_configs_for_android(package, configs, opt)
local ndk = get_config("ndk")
if ndk and os.isdir(ndk) then
local ndk_sdkver = get_config("ndk_sdkver")
- local ndk_cxxstl = get_config("ndk_cxxstl")
table.insert(configs, "-DCMAKE_TOOLCHAIN_FILE=" .. path.join(ndk, "build/cmake/android.toolchain.cmake"))
+ table.insert(configs, "-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF")
table.insert(configs, "-DANDROID_ABI=" .. package:arch())
if ndk_sdkver then
table.insert(configs, "-DANDROID_PLATFORM=android-" .. ndk_sdkver)
table.insert(configs, "-DANDROID_NATIVE_API_LEVEL=" .. ndk_sdkver)
end
- if ndk_cxxstl then
- table.insert(configs, "-DANDROID_STL=" .. ndk_cxxstl)
+ -- https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_STL_TYPE.html
+ local runtime = package:runtimes()
+ if runtime then
+ table.insert(configs, "-DCMAKE_ANDROID_STL_TYPE=" .. runtime)
end
if is_host("windows") and opt.cmake_generator ~= "Ninja" then
local make = path.join(ndk, "prebuilt", "windows-x86_64", "bin", "make.exe")