Skip to content

Commit 2a1bdf5

Browse files
committed
Fix version comp
1 parent 61f7ab4 commit 2a1bdf5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xmake/toolchains/ndk/load.lua

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

2121
-- imports
2222
import("core.base.hashset")
23+
import("core.base.semver")
2324
import("core.project.config")
2425

2526
-- get triple
@@ -96,7 +97,7 @@ function main(toolchain)
9697
-- gnustl and stlport have been removed in ndk r18 (deprecated in ndk r17)
9798
-- https://github.com/android/ndk/wiki/Changelog-r18
9899
local old_runtimes = {"gnustl_static", "gnustl_shared", "stlport_static", "stlport_shared"}
99-
if ndk_sdkver < 18 then
100+
if ndk_sdkver and semver.new(ndk_sdkver):le("r18") then
100101
toolchain:add("runtimes", tabl.unpack(old_runtimes))
101102
end
102103

@@ -220,7 +221,7 @@ function main(toolchain)
220221
local cxxstl_sdkdir = nil
221222
local ndk_cxxstl = config.get("runtimes") or config.get("ndk_cxxstl")
222223
if ndk_cxxstl then
223-
if (ndk_sdkver >= 18) and table.contains(old_runtimes, ndk_cxxstl) then
224+
if (ndk_sdkver and semver.new(ndk_sdkver):ge("r18")) and table.contains(old_runtimes, ndk_cxxstl) then
224225
utils.warning("%s is was removed in ndk v%s", ndk_cxxstl, ndk_sdkver)
225226
end
226227

0 commit comments

Comments
 (0)