diff options
Diffstat (limited to 'xmake/modules/private/tools/vstool.lua')
| -rw-r--r-- | xmake/modules/private/tools/vstool.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/modules/private/tools/vstool.lua b/xmake/modules/private/tools/vstool.lua index e632ed00f..c8f51b11b 100644 --- a/xmake/modules/private/tools/vstool.lua +++ b/xmake/modules/private/tools/vstool.lua @@ -31,10 +31,11 @@ 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 - local envs = {VS_UNICODE_OUTPUT = outfile:rawfd()} + opt.envs = opt.envs or {} + opt.envs.VS_UNICODE_OUTPUT = outfile:rawfd() -- execute it - local ok, syserrors = os.execv(program, argv, table.join(opt, {try = true, stdout = outfile, stderr = errpath, envs = envs})) + local ok, syserrors = os.execv(program, argv, table.join(opt, {try = true, stdout = outfile, stderr = errpath})) -- close outfile first outfile:close() @@ -93,10 +94,11 @@ 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 - local envs = {VS_UNICODE_OUTPUT = outfile:rawfd()} + opt.envs = opt.envs or {} + opt.envs.VS_UNICODE_OUTPUT = outfile:rawfd() -- run command - local ok, syserrors = os.execv(program, argv, table.join(opt, {try = true, stdout = outfile, stderr = errpath, envs = envs})) + local ok, syserrors = os.execv(program, argv, table.join(opt, {try = true, stdout = outfile, stderr = errpath})) -- get output and error data outfile:close() @@ -132,7 +134,7 @@ function iorunv(program, argv, opt) errors = string.format("vstool.iorunv(%s), %s", cmd, syserrors and syserrors or "unknown reason") end end - + -- raise errors os.raise({errors = errors, stderr = errdata, stdout = outdata}) end |
