summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/link.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/link.lua
parente657f348e658d91255fd01d347faf74ccafdfa4e (diff)
fix cmd length limit
Diffstat (limited to 'xmake/modules/core/tools/link.lua')
-rw-r--r--xmake/modules/core/tools/link.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index f9cde52ec..ae2112559 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -90,7 +90,18 @@ end
-- make the link arguments list
function linkargv(self, objectfiles, targetkind, targetfile, flags)
- return self:program(), table.join(flags, "-out:" .. targetfile, objectfiles)
+
+ -- init arguments
+ local argv = table.join(flags, "-out:" .. targetfile, objectfiles)
+
+ -- too long arguments for windows?
+ local args = os.args(argv)
+ if #args > 1024 then
+ local argsfile = os.tmpfile(args) .. ".args.txt"
+ io.writefile(argsfile, args)
+ argv = {"@" .. argsfile}
+ end
+ return self:program(), argv
end
-- link the target file