summaryrefslogtreecommitdiff
path: root/xmake/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-09 22:34:16 +0800
committerruki <[email protected]>2016-07-09 22:34:16 +0800
commitf54223a97ba93b02128df84d52d3efe7abd2a36a (patch)
treeb6d5e5d1b4d70bd1eeadf936751eb50930f3bab6 /xmake/tools/gcc.lua
parent0d3075a0739eff0e28db11889a62ed3db8f4ab9f (diff)
add archiver and extractor
Diffstat (limited to 'xmake/tools/gcc.lua')
-rwxr-xr-xxmake/tools/gcc.lua25
1 files changed, 17 insertions, 8 deletions
diff --git a/xmake/tools/gcc.lua b/xmake/tools/gcc.lua
index 9b81c456c..5019aa06f 100755
--- a/xmake/tools/gcc.lua
+++ b/xmake/tools/gcc.lua
@@ -20,6 +20,10 @@
-- @file gcc.lua
--
+-- imports
+import("core.tool.tool")
+import("core.project.config")
+
-- init it
function init(shellname, kind)
@@ -111,8 +115,20 @@ end
-- make the complie command
function compcmd(sourcefile, objectfile, flags)
+ -- get ccache
+ local ccache = nil
+ if config.get("ccache") then
+ ccache = tool.shellname("ccache")
+ end
+
-- make it
- return format("%s -c %s -o %s %s", _g.shellname, flags, objectfile, sourcefile)
+ local command = format("%s -c %s -o %s %s", _g.shellname, flags, objectfile, sourcefile)
+ if ccache then
+ command = ccache:append(command, " ")
+ end
+
+ -- ok
+ return command
end
-- link the target file
@@ -139,13 +155,6 @@ function compile(sourcefile, objectfile, flags, multitasking)
end
end
--- run command
-function run(...)
-
- -- run it
- os.run(...)
-end
-
-- check the given flags
function check(flags)