Skip to content

Commit 124001b

Browse files
committed
Fix confusion between ndk_sdkver and ndkver
1 parent 567389c commit 124001b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

xmake/toolchains/ndk/load.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
-- imports
2222
import("core.base.hashset")
23-
import("core.base.semver")
2423
import("core.project.config")
2524

2625
-- get triple
@@ -97,7 +96,7 @@ function main(toolchain)
9796
-- gnustl and stlport have been removed in ndk r18 (deprecated in ndk r17)
9897
-- https://github.com/android/ndk/wiki/Changelog-r18
9998
local old_runtimes = {"gnustl_static", "gnustl_shared", "stlport_static", "stlport_shared"}
100-
if ndk_sdkver and semver.new(format("%s.0.0", ndk_sdkver)):le("18.0.0") then
99+
if ndkver and ndkver < 18 then
101100
toolchain:add("runtimes", table.unpack(old_runtimes))
102101
end
103102

@@ -221,7 +220,7 @@ function main(toolchain)
221220
local cxxstl_sdkdir = nil
222221
local ndk_cxxstl = config.get("runtimes") or config.get("ndk_cxxstl")
223222
if ndk_cxxstl then
224-
if (ndk_sdkver and semver.new(format("%s.0.0", ndk_sdkver)):ge("18.0.0")) and table.contains(old_runtimes, ndk_cxxstl) then
223+
if (ndkver and ndkver >= 18) and table.contains(old_runtimes, ndk_cxxstl) then
225224
utils.warning("%s is was removed in ndk v%s", ndk_cxxstl, ndk_sdkver)
226225
end
227226

0 commit comments

Comments
 (0)