summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/ar.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-05-22 00:28:30 +0800
committerruki <[email protected]>2018-05-21 20:51:03 +0800
commit25eab76f405d681b06c93a00e0e9a2b3f5b65644 (patch)
tree7d81427fe77472aef17684c245b375470f9ea0fa /xmake/modules/core/tools/ar.lua
parente657f348e658d91255fd01d347faf74ccafdfa4e (diff)
fix cmd length limit
Diffstat (limited to 'xmake/modules/core/tools/ar.lua')
-rw-r--r--xmake/modules/core/tools/ar.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/ar.lua b/xmake/modules/core/tools/ar.lua
index de70ddc46..2834e111c 100644
--- a/xmake/modules/core/tools/ar.lua
+++ b/xmake/modules/core/tools/ar.lua
@@ -55,8 +55,21 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags)
-- check
assert(targetkind == "static")
+ -- init arguments
+ local argv = table.join(flags, targetfile, objectfiles)
+
+ -- too long arguments for windows?
+ if is_host("windows") then
+ local args = os.args(argv)
+ if #args > 1024 then
+ local argsfile = os.tmpfile(args) .. ".args.txt"
+ io.writefile(argsfile, args)
+ argv = {"@" .. argsfile}
+ end
+ end
+
-- make it
- return self:program(), table.join(flags, targetfile, objectfiles)
+ return self:program(), argv
end
-- link the library file