diff options
| author | ruki <[email protected]> | 2020-06-17 23:32:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-17 15:13:08 +0800 |
| commit | dcaeda333910bc331fc706394cef7dd8fa81b1fe (patch) | |
| tree | 86dac91ccdcb5f1c308d9f6abb462a49c7c124dd /xmake/core | |
| parent | 4e63f6c65ebb262333080f663702672eb9787bcf (diff) | |
improve cl to support 8192 limit
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/base/winos.lua | 5 | ||||
| -rw-r--r-- | xmake/core/tool/compiler.lua | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua index 5841f5a6c..40283e4f5 100644 --- a/xmake/core/base/winos.lua +++ b/xmake/core/base/winos.lua @@ -154,14 +154,15 @@ end function winos.cmdargv(argv, key) -- too long arguments? + local limit = 4096 local argn = 0 for _, arg in ipairs(argv) do argn = argn + #arg - if argn > 1024 then + if argn > limit then break end end - if argn > 1024 then + if argn > limit then local argsfile = os.tmpfile(key or table.concat(argv, '')) .. ".args.txt" local f = io.open(argsfile, 'w') if f then diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua index b99bfdfca..e56f2d300 100644 --- a/xmake/core/tool/compiler.lua +++ b/xmake/core/tool/compiler.lua @@ -254,7 +254,7 @@ function compiler:compargv(sourcefiles, objectfile, opt) end compflags = self:compflags(opt) end - return self:_tool():compargv(sourcefiles, objectfile, compflags) + return self:_tool():compargv(sourcefiles, objectfile, compflags, opt) end -- get the compile command |
