diff options
Diffstat (limited to 'xmake/modules/core/tools/ar.lua')
| -rw-r--r-- | xmake/modules/core/tools/ar.lua | 15 |
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 |
