diff options
| author | 白喵 <[email protected]> | 2024-07-04 12:37:25 +0800 |
|---|---|---|
| committer | 白喵 <[email protected]> | 2024-07-04 12:37:25 +0800 |
| commit | d77ca871e7edc2b5cdfae70f5073dca247d6cc58 (patch) | |
| tree | 691bab941df019f2caeb6794913bb580598956de /xmake/modules/private/tools/vstool.lua | |
| parent | c1802f741f225ef32109fa0f8adc396528a18951 (diff) | |
fix msvc output when toolset less than 8.0
Diffstat (limited to 'xmake/modules/private/tools/vstool.lua')
| -rw-r--r-- | xmake/modules/private/tools/vstool.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xmake/modules/private/tools/vstool.lua b/xmake/modules/private/tools/vstool.lua index 97a278d7b..68db4a949 100644 --- a/xmake/modules/private/tools/vstool.lua +++ b/xmake/modules/private/tools/vstool.lua @@ -24,6 +24,12 @@ function runv(program, argv, opt) -- init options opt = opt or {} + -- if has VS_BINARY_OUTPUT dont enable unicode output + local envs = opt.envs or {} + if envs.VS_BINARY_OUTPUT then + return os.runv(program, argv, opt) + end + -- make temporary output and error file local outpath = os.tmpfile() local errpath = os.tmpfile() @@ -31,7 +37,7 @@ function runv(program, argv, opt) -- enable unicode output for vs toolchains, e.g. cl.exe, link.exe and etc. -- @see https://github.com/xmake-io/xmake/issues/528 - opt.envs = table.join(opt.envs or {}, {VS_UNICODE_OUTPUT = outfile:rawfd()}) + opt.envs = table.join(envs, {VS_UNICODE_OUTPUT = outfile:rawfd()}) -- execute it local ok, syserrors = os.execv(program, argv, table.join(opt, {try = true, stdout = outfile, stderr = errpath})) @@ -85,6 +91,12 @@ function iorunv(program, argv, opt) -- init options opt = opt or {} + + -- if has VS_BINARY_OUTPUT dont enable unicode output + local envs = opt.envs or {} + if envs.VS_BINARY_OUTPUT then + return os.runv(program, argv, opt) + end -- make temporary output and error file local outpath = os.tmpfile() @@ -93,7 +105,7 @@ function iorunv(program, argv, opt) -- enable unicode output for vs toolchains, e.g. cl.exe, link.exe and etc. -- @see https://github.com/xmake-io/xmake/issues/528 - opt.envs = table.join(opt.envs or {}, {VS_UNICODE_OUTPUT = outfile:rawfd()}) + opt.envs = table.join(envs, {VS_UNICODE_OUTPUT = outfile:rawfd()}) -- run command local ok, syserrors = os.execv(program, argv, table.join(opt, {try = true, stdout = outfile, stderr = errpath})) |
