diff options
| author | ruki <[email protected]> | 2026-06-25 00:38:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-06-25 00:38:45 +0800 |
| commit | b1883415dc88a1438aa0259a99453b8d165cac0f (patch) | |
| tree | 16b2b03214de68494f457aedb0f498c212038157 | |
| parent | 44711c34a5bfcb192df4985a30e4dfb1c4441c23 (diff) | |
use vstool.iorunv in has_flags
| -rw-r--r-- | xmake/modules/core/tools/cl/has_flags.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/cl/has_flags.lua b/xmake/modules/core/tools/cl/has_flags.lua index dfef0e1c2..e4de5a8b4 100644 --- a/xmake/modules/core/tools/cl/has_flags.lua +++ b/xmake/modules/core/tools/cl/has_flags.lua @@ -22,6 +22,7 @@ import("core.language.language") import("core.cache.global_detectcache") import("core.tools.cl.check_knownargs") +import("private.tools.vstool") -- attempt to check it from the argument list function _check_from_arglist(flags, opt) @@ -30,7 +31,8 @@ function _check_from_arglist(flags, opt) local allflags = global_detectcache:get2(key, flagskey) if not allflags then allflags = {} - local arglist = os.iorunv(opt.program, {"-?"}, {envs = opt.envs}) + -- @see https://github.com/xmake-io/xmake/issues/7610 + local arglist = vstool.iorunv(opt.program, {"-?"}, {envs = opt.envs}) if arglist then for arg in arglist:gmatch("(/[%-%a%d]+)%s+") do allflags[arg:gsub("/", "-")] = true @@ -67,7 +69,7 @@ function _check_try_running(flags, opt) tmpfile = os.tmpfile() nuldev = tmpfile end - local _, errs = os.iorunv(opt.program, table.join("-c", "-nologo", flags, "-Fo" .. nuldev, sourcefile), + local _, errs = vstool.iorunv(opt.program, table.join("-c", "-nologo", flags, "-Fo" .. nuldev, sourcefile), {envs = opt.envs, curdir = tmpdir}) -- we need to switch to tmpdir to avoid generating some tmp files, e.g. /Zi -> vc140.pdb if tmpfile then os.tryrm(tmpfile) |
