diff options
| author | ruki <[email protected]> | 2022-07-13 22:37:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-13 22:37:56 +0800 |
| commit | 4123779a18ab0be9517b4a81928f0bf54861755e (patch) | |
| tree | ab9ebafa4045145ca78c3f71cfb00bda4f65ff96 | |
| parent | 4182acf2300bb030938be6b77ab8a8b131fa2ebd (diff) | |
fix winos.cmdargv
| -rw-r--r-- | xmake/core/base/winos.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua index 72a53731e..f8b45288a 100644 --- a/xmake/core/base/winos.lua +++ b/xmake/core/base/winos.lua @@ -173,6 +173,10 @@ function winos.cmdargv(argv, opt) local idx = 1 while idx <= #argv do arg = tostring(argv[idx]) + arg1 = argv[idx + 1] + if arg1 then + arg1 = tostring(arg1) + end -- we need ensure `/name value` in same line, -- otherwise cl.exe will prompt that the corresponding parameter value cannot be found -- @@ -182,9 +186,9 @@ function winos.cmdargv(argv, opt) -- -Dxxx -- foo.obj -- - if idx + 1 <= #argv and arg:find("^[-/]") and not tostring(argv[idx + 1]):find("^[-/]") then + if idx + 1 <= #argv and arg:find("^[-/]") and not arg1:find("^[-/]") then f:write(os.args(arg, {escape = opt.escape}) .. " ") - f:write(os.args(argv[idx + 1], {escape = opt.escape}) .. "\n") + f:write(os.args(arg1, {escape = opt.escape}) .. "\n") idx = idx + 2 else f:write(os.args(arg, {escape = opt.escape}) .. "\n") |
