diff options
| author | ruki <[email protected]> | 2015-06-16 18:27:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-16 18:27:00 +0800 |
| commit | d549aaedf96e6d6eb77e9d588dc0a0269cd1ae71 (patch) | |
| tree | 51d971fe326561b62895743a38a1544af6df2dff /xmake/scripts/tools/gcc.lua | |
| parent | 608602d0de1056f856e0b6bfe33b3f5fbe641b63 (diff) | |
fix the command is too long for nmake
Diffstat (limited to 'xmake/scripts/tools/gcc.lua')
| -rw-r--r-- | xmake/scripts/tools/gcc.lua | 16 |
1 files changed, 12 insertions, 4 deletions
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 |
