Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtimes only if the ndk version is low enough #5565

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions xmake/toolchains/ndk/load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ function main(toolchain)
toolchain:set("toolset", "ranlib", gcc_toolchain_bin and path.join(gcc_toolchain_bin, cross .. "ranlib") or (cross .. "ranlib"))
toolchain:set("toolset", "strip", gcc_toolchain_bin and path.join(gcc_toolchain_bin, cross .. "strip") or (cross .. "strip"), "llvm-strip")

-- gnustl and stlport have been removed in ndk r18 (deprecated in ndk r17)
-- https://github.com/android/ndk/wiki/Changelog-r18
local old_runtimes = {"gnustl_static", "gnustl_shared", "stlport_static", "stlport_shared"}
if ndkver and ndkver < 18 then
toolchain:add("runtimes", table.unpack(old_runtimes))
end

-- init flags
local arm32 = false
local arch = toolchain:arch()
Expand Down Expand Up @@ -213,6 +220,10 @@ function main(toolchain)
local cxxstl_sdkdir = nil
local ndk_cxxstl = config.get("runtimes") or config.get("ndk_cxxstl")
if ndk_cxxstl then
if (ndkver and ndkver >= 18) and table.contains(old_runtimes, ndk_cxxstl) then
utils.warning("%s is was removed in ndk v%s", ndk_cxxstl, ndk_sdkver)
end

if ndk_cxxstl:find(",", 1, true) then
local runtimes_supported = hashset.from(toolchain:get("runtimes"))
for _, item in ipairs(ndk_cxxstl:split(",")) do
Expand Down
2 changes: 1 addition & 1 deletion xmake/toolchains/ndk/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ toolchain("ndk")
set_kind("standalone")
set_homepage("https://developer.android.com/ndk")
set_description("Android NDK")
set_runtimes("c++_static", "c++_shared", "gnustl_static", "gnustl_shared", "stlport_static", "stlport_shared")
set_runtimes("c++_static", "c++_shared")

on_check("check")
on_load("load")
Loading