diff options
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})) |
