summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2023-09-10 19:05:57 +0800
committerstar9029 <[email protected]>2023-09-10 19:05:57 +0800
commit26d160af0e6ef9aa303ff70aa13b763a63b3ff97 (patch)
tree07019b62aff17108f921b7d07de1359e9e41b19f
parenta7d1f2636f91ab5758cee05c100ef7803bc9a224 (diff)
improve vs asan version
-rw-r--r--xmake/rules/mode/xmake.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/rules/mode/xmake.lua b/xmake/rules/mode/xmake.lua
index ab1df212a..e2bfc298b 100644
--- a/xmake/rules/mode/xmake.lua
+++ b/xmake/rules/mode/xmake.lua
@@ -186,6 +186,7 @@ rule("mode.coverage")
rule("mode.asan")
on_config(function (target)
import("lib.detect.find_tool")
+ import("core.base.semver")
-- is asan mode now? xmake f -m asan
if is_mode("asan") then
@@ -215,7 +216,7 @@ rule("mode.asan")
if msvc then
local envs = msvc:runenvs()
local vscmd_ver = envs and envs.VSCMD_VER
- if vscmd_ver and vscmd_ver:startswith("17.7") then
+ if vscmd_ver and semver.match(vscmd_ver):ge("17.7") then
local cl = assert(find_tool("cl", {envs = envs}), "cl not found!")
target:add("runenvs", "PATH", path.directory(cl.program))
end