summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-21 22:30:20 +0800
committerruki <[email protected]>2025-05-21 22:30:20 +0800
commitef0e7845588e1ae87b3126cc0b9ff1a71834d4c3 (patch)
tree54f85746a84767d9b0893dd3abef5459c91d22ba
parentbcafeff3c75b26de9b156ed7e7b405e385491084 (diff)
fix #6474
-rw-r--r--xmake/modules/detect/tools/find_cl.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/modules/detect/tools/find_cl.lua b/xmake/modules/detect/tools/find_cl.lua
index 4f0fb8f77..773ec57e7 100644
--- a/xmake/modules/detect/tools/find_cl.lua
+++ b/xmake/modules/detect/tools/find_cl.lua
@@ -62,7 +62,9 @@ function main(opt)
return info
end
opt.parse = opt.parse or function (output)
- return output:match("(%d+%.%d+%.%d*.-)%s")
+ -- we only keep the first three digits of the version number, making sure to provide a valid semver string.
+ -- @see https://github.com/xmake-io/xmake/issues/6474
+ return output:match("%s(%d+%.%d+%.%d+)")
end
version = find_programver(program, opt)
end