summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/ar.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-11-10 23:47:15 +0800
committerruki <[email protected]>2017-11-10 16:43:32 +0800
commit24bdac45ba26a318fd07b2bad0baa6d1bdc28fa9 (patch)
treeb0fa91fc30d3dd6804966f5b4950c5a6ea785877 /xmake/modules/core/tools/ar.lua
parent5605084d64edb44917f7e69752335d1fdf979515 (diff)
improve ar.lua on windows cmd
Diffstat (limited to 'xmake/modules/core/tools/ar.lua')
-rw-r--r--xmake/modules/core/tools/ar.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/ar.lua b/xmake/modules/core/tools/ar.lua
index 650ca7b27..dc2404d06 100644
--- a/xmake/modules/core/tools/ar.lua
+++ b/xmake/modules/core/tools/ar.lua
@@ -55,8 +55,19 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags)
-- check
assert(targetkind == "static")
- -- make it
- return self:program(), table.join(flags, targetfile, objectfiles)
+ -- make arguments list
+ local argv = table.join(flags, targetfile, objectfiles)
+
+ -- too long?
+ local args = os.args(argv)
+ if #args > 4096 and os.host() == "windows" then
+ local argfile = targetfile .. ".arg"
+ io.printf(argfile, args)
+ argv = {"@" .. argfile}
+ end
+
+ -- ok?
+ return self:program(), argv
end
-- link the library file