diff options
| author | DavidWang19 <[email protected]> | 2026-05-02 21:56:20 +0100 |
|---|---|---|
| committer | DavidWang19 <[email protected]> | 2026-05-02 22:24:39 +0100 |
| commit | 05f0bb724f1e2d59d851828cb5d16d64ef98b860 (patch) | |
| tree | c5cbc0bc3a26c9726563e47520eee92963318658 /xmake/modules/lib | |
| parent | 1e431c685f2f2b4f28e6995e256fc6c7c4bf3d13 (diff) | |
fix msvc/intel/snippet detect when temp path contains spaces
Pass the temp bat / test binary via the *v variants of os.run / iorun /
vrun so os.argv does not split the path on whitespace.
Diffstat (limited to 'xmake/modules/lib')
| -rw-r--r-- | xmake/modules/lib/detect/check_cxsnippets.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/lib/detect/check_fcsnippets.lua | 7 |
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..48a0f189b 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..b6dcd8f46 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 |
