summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-31 00:45:20 +0800
committerruki <[email protected]>2019-08-30 22:32:04 +0800
commitbb3a62022b775dc837cbd15359d6cc56588921ac (patch)
tree0477b7e94c3e05f37c12a193dd76a6e4726a774c /xmake/modules/core/tools/gcc.lua
parentb58574872f3475ac541580ba29068a790a63ecaf (diff)
improve ccache
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua28
1 files changed, 2 insertions, 26 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 9b96daf91..3574f869c 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -23,7 +23,7 @@ import("core.base.option")
import("core.project.config")
import("core.project.project")
import("core.language.language")
-import("detect.tools.find_ccache")
+import("private.tools.ccache")
import("private.tools.gcc.parse_deps")
-- init it
@@ -366,31 +366,7 @@ function _compargv1(self, sourcefile, objectfile, flags)
if (extension:startswith(".h") or extension == ".inl") then
return _compargv1_pch(self, sourcefile, objectfile, flags)
end
-
- -- get ccache
- local ccache = nil
- if config.get("ccache") then
- ccache = find_ccache()
- end
-
- -- make argv
- local argv = table.join("-c", flags, "-o", objectfile, sourcefile)
-
- -- uses cache?
- local program = self:program()
- if ccache then
-
- -- parse the filename and arguments, e.g. "xcrun -sdk macosx clang"
- if not os.isexec(program) then
- argv = table.join(program:split("%s"), argv)
- else
- table.insert(argv, 1, program)
- end
- return ccache, argv
- end
-
- -- no cache
- return program, argv
+ return ccache.cmdargv(self:program(), table.join("-c", flags, "-o", objectfile, sourcefile))
end
-- compile the source file