summaryrefslogtreecommitdiff
path: root/xmake/core/base/winos.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-12 22:39:10 +0800
committerruki <[email protected]>2022-07-12 22:39:10 +0800
commit01ec42cdbadcebf541fa078537b09eb7afbfad43 (patch)
treed74db0143c4ec1168175ed2cf97f644d14e2ae33 /xmake/core/base/winos.lua
parenta7a21777f4c6125d9830a264bc508d2f805d9e1b (diff)
improve winos.cmdargv
Diffstat (limited to 'xmake/core/base/winos.lua')
-rw-r--r--xmake/core/base/winos.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua
index f68da88d4..b14368b16 100644
--- a/xmake/core/base/winos.lua
+++ b/xmake/core/base/winos.lua
@@ -164,14 +164,14 @@ function winos.cmdargv(argv, opt)
end
if argn > limit then
opt = opt or {}
- local argsfile = os.tmpfile(opt.tmpkey or table.concat(argv, '')) .. ".args.txt"
+ local argsfile = os.tmpfile(opt.tmpkey or os.args(argv)) .. ".args.txt"
local f = io.open(argsfile, 'w', {encoding = "ansi"})
if f then
-- we need split args file to solve `fatal error LNK1170: line in command file contains 131071 or more characters`
-- @see https://github.com/xmake-io/xmake/issues/812
local idx = 1
while idx <= #argv do
- arg = argv[idx]
+ arg = tostring(argv[idx])
-- we need ensure `/name value` in same line,
-- otherwise cl.exe will prompt that the corresponding parameter value cannot be found
--
@@ -181,7 +181,7 @@ function winos.cmdargv(argv, opt)
-- -Dxxx
-- foo.obj
--
- if idx + 1 <= #argv and arg:find("^[-/]") and not argv[idx + 1]:find("^[-/]") then
+ if idx + 1 <= #argv and arg:find("^[-/]") and not tostring(argv[idx + 1]):find("^[-/]") then
f:write(os.args(arg, {escape = opt.escape}) .. " ")
f:write(os.args(argv[idx + 1], {escape = opt.escape}) .. "\n")
idx = idx + 2