From d549aaedf96e6d6eb77e9d588dc0a0269cd1ae71 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 16 Jun 2015 18:27:00 +0800 Subject: fix the command is too long for nmake --- xmake/scripts/tools/gcc.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'xmake/scripts/tools/gcc.lua') diff --git a/xmake/scripts/tools/gcc.lua b/xmake/scripts/tools/gcc.lua index 6a5fc9d82..d02384494 100644 --- a/xmake/scripts/tools/gcc.lua +++ b/xmake/scripts/tools/gcc.lua @@ -112,17 +112,25 @@ function gcc.init(self, name) end -- make the compile command -function gcc.command_compile(self, srcfile, objfile, flags) +function gcc.command_compile(self, srcfile, objfile, flags, logfile) + + -- redirect + local redirect = "" + if logfile then redirect = string.format(" > %s 2>&1", logfile) end -- make it - return string.format("%s -c %s -o %s %s", self._NAME, flags, objfile, srcfile) + return string.format("%s -c %s -o %s %s%s", self._NAME, flags, objfile, srcfile, redirect) end -- make the link command -function gcc.command_link(self, objfiles, targetfile, flags) +function gcc.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 -o %s %s %s", self._NAME, targetfile, objfiles, flags) + return string.format("%s -o %s %s %s%s", self._NAME, targetfile, objfiles, flags, redirect) end -- make the define flag -- cgit v1.3.1