summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform/windows/tools/link.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-16 18:27:00 +0800
committerruki <[email protected]>2015-06-16 18:27:00 +0800
commitd549aaedf96e6d6eb77e9d588dc0a0269cd1ae71 (patch)
tree51d971fe326561b62895743a38a1544af6df2dff /xmake/scripts/platform/windows/tools/link.lua
parent608602d0de1056f856e0b6bfe33b3f5fbe641b63 (diff)
fix the command is too long for nmake
Diffstat (limited to 'xmake/scripts/platform/windows/tools/link.lua')
-rw-r--r--xmake/scripts/platform/windows/tools/link.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/xmake/scripts/platform/windows/tools/link.lua b/xmake/scripts/platform/windows/tools/link.lua
index 7eb56ffc9..06be1ac47 100644
--- a/xmake/scripts/platform/windows/tools/link.lua
+++ b/xmake/scripts/platform/windows/tools/link.lua
@@ -52,10 +52,10 @@ function link.init(self, name)
, flags_arch}
-- init arflags
- self.arflags = {"-lib", "-nologo", flags_arch}
+ self.arflags = {"-nologo", flags_arch}
-- init shflags
- self.shflags = {"-dll", "-nologo", flags_arch}
+ self.shflags = {"-nologo", flags_arch}
-- init flags map
self.mapflags =
@@ -73,10 +73,22 @@ function link.init(self, name)
end
-- make the linker command
-function link.command_link(self, objfiles, targetfile, flags)
+function link.command_link(self, objfiles, targetfile, flags, logfile)
+
+ -- redirect
+ local redirect = ""
+ if logfile then redirect = string.format(" > %s 2>&1", logfile) end
-- make it
- return string.format("%s %s -out:%s %s", self._NAME, flags, targetfile, objfiles)
+ local cmd = string.format("%s %s -out:%s %s%s", self._NAME, flags, targetfile, objfiles, redirect)
+
+ -- too long?
+ if #cmd > 256 then
+ cmd = string.format("%s%s @<<\n%s -out:%s %s\n<<", self._NAME, redirect, flags, targetfile, objfiles)
+ end
+
+ -- ok?
+ return cmd
end
-- make the link flag