From bb3a62022b775dc837cbd15359d6cc56588921ac Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 31 Aug 2019 00:45:20 +0800 Subject: improve ccache --- xmake/modules/core/tools/tcc.lua | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'xmake/modules/core/tools/tcc.lua') diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua index 51a11df93..1df92293c 100644 --- a/xmake/modules/core/tools/tcc.lua +++ b/xmake/modules/core/tools/tcc.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") -- init it function init(self) @@ -157,31 +157,7 @@ end -- make the compile arguments list function _compargv1(self, sourcefile, objectfile, flags) - - -- 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 -- cgit v1.3.1