diff options
| author | ruki <[email protected]> | 2016-07-09 22:34:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-09 22:34:16 +0800 |
| commit | f54223a97ba93b02128df84d52d3efe7abd2a36a (patch) | |
| tree | b6d5e5d1b4d70bd1eeadf936751eb50930f3bab6 /xmake/tools/swiftc.lua | |
| parent | 0d3075a0739eff0e28db11889a62ed3db8f4ab9f (diff) | |
add archiver and extractor
Diffstat (limited to 'xmake/tools/swiftc.lua')
| -rw-r--r-- | xmake/tools/swiftc.lua | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/xmake/tools/swiftc.lua b/xmake/tools/swiftc.lua index cb391b0f8..9f7842440 100644 --- a/xmake/tools/swiftc.lua +++ b/xmake/tools/swiftc.lua @@ -21,6 +21,7 @@ -- -- imports +import("core.tool.tool") import("core.project.config") -- init it @@ -76,8 +77,20 @@ end -- make the compile 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 -- complie the source file @@ -115,13 +128,6 @@ function undefine(macro) return "-Xcc -U" .. macro end --- run command -function run(...) - - -- run it - os.run(...) -end - -- check the given flags function check(flags) |
