@@ -24,14 +24,20 @@ function runv(program, argv, opt)
24
24
-- init options
25
25
opt = opt or {}
26
26
27
+ -- if has VS_BINARY_OUTPUT dont enable unicode output
28
+ local envs = opt .envs or {}
29
+ if envs .VS_BINARY_OUTPUT then
30
+ return os .runv (program , argv , opt )
31
+ end
32
+
27
33
-- make temporary output and error file
28
34
local outpath = os .tmpfile ()
29
35
local errpath = os .tmpfile ()
30
36
local outfile = io.open (outpath , ' w' )
31
37
32
38
-- enable unicode output for vs toolchains, e.g. cl.exe, link.exe and etc.
33
39
-- @see https://github.com/xmake-io/xmake/issues/528
34
- opt .envs = table .join (opt . envs or {} , {VS_UNICODE_OUTPUT = outfile :rawfd ()})
40
+ opt .envs = table .join (envs , {VS_UNICODE_OUTPUT = outfile :rawfd ()})
35
41
36
42
-- execute it
37
43
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)
85
91
86
92
-- init options
87
93
opt = opt or {}
94
+
95
+ -- if has VS_BINARY_OUTPUT dont enable unicode output
96
+ local envs = opt .envs or {}
97
+ if envs .VS_BINARY_OUTPUT then
98
+ return os .runv (program , argv , opt )
99
+ end
88
100
89
101
-- make temporary output and error file
90
102
local outpath = os .tmpfile ()
@@ -93,7 +105,7 @@ function iorunv(program, argv, opt)
93
105
94
106
-- enable unicode output for vs toolchains, e.g. cl.exe, link.exe and etc.
95
107
-- @see https://github.com/xmake-io/xmake/issues/528
96
- opt .envs = table .join (opt . envs or {} , {VS_UNICODE_OUTPUT = outfile :rawfd ()})
108
+ opt .envs = table .join (envs , {VS_UNICODE_OUTPUT = outfile :rawfd ()})
97
109
98
110
-- run command
99
111
local ok , syserrors = os .execv (program , argv , table .join (opt , {try = true , stdout = outfile , stderr = errpath }))
0 commit comments