summaryrefslogtreecommitdiff
path: root/xmake/modules/lib/detect
diff options
context:
space:
mode:
authorruki <[email protected]>2026-05-03 21:09:19 +0800
committerGitHub <[email protected]>2026-05-03 21:09:19 +0800
commit8bbbb2860fdd1910db466fe318ee8d465728ca32 (patch)
tree8660cf81b640c9a116a068fd2b105da92bc57cd5 /xmake/modules/lib/detect
parent1e431c685f2f2b4f28e6995e256fc6c7c4bf3d13 (diff)
parent7778b7cb39646016c30bf3c6bf1e1897edc26529 (diff)
Merge pull request #7523 from DavidWang19/fix/detect-bat-path-with-spaces
Fix msvc/intel/snippet detect when temp path contains spaces
Diffstat (limited to 'xmake/modules/lib/detect')
-rw-r--r--xmake/modules/lib/detect/check_cxsnippets.lua7
-rw-r--r--xmake/modules/lib/detect/check_fcsnippets.lua7
2 files changed, 10 insertions, 4 deletions
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua
index 1e7dc604b..a6910522a 100644
--- a/xmake/modules/lib/detect/check_cxsnippets.lua
+++ b/xmake/modules/lib/detect/check_cxsnippets.lua
@@ -255,14 +255,17 @@ function main(snippets, opt)
linker.link("binary", {"cc", "cxx"}, objectfile, binaryfile, opt)
end
if opt.tryrun then
+ -- @note we use the *v variants so the binary path is not split on
+ -- whitespace by os.argv. mostly hits on Windows where TEMP lives
+ -- under the user profile and may contain spaces.
if opt.output then
- local output = os.iorun(binaryfile)
+ local output = os.iorunv(binaryfile)
if output then
output = output:trim()
end
return true, output
else
- os.vrun(binaryfile)
+ os.vrunv(binaryfile)
end
end
local binary_match = opt.binary_match
diff --git a/xmake/modules/lib/detect/check_fcsnippets.lua b/xmake/modules/lib/detect/check_fcsnippets.lua
index 7314c96f8..a6b93cbbf 100644
--- a/xmake/modules/lib/detect/check_fcsnippets.lua
+++ b/xmake/modules/lib/detect/check_fcsnippets.lua
@@ -114,14 +114,17 @@ function main(snippets, opt)
linker.link("binary", linkerkind, objectfile, binaryfile, opt)
end
if opt.tryrun then
+ -- @note we use the *v variants so the binary path is not split on
+ -- whitespace by os.argv. mostly hits on Windows where TEMP lives
+ -- under the user profile and may contain spaces.
if opt.output then
- local output = os.iorun(binaryfile)
+ local output = os.iorunv(binaryfile)
if output then
output = output:trim()
end
return true, output
else
- os.vrun(binaryfile)
+ os.vrunv(binaryfile)
end
end
local binary_match = opt.binary_match