summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cparser.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-04 10:09:50 +0800
committerGitHub <[email protected]>2019-09-04 10:09:50 +0800
commit1a1eac4f9e099eed250d72f309cf479efbb15a1c (patch)
treebd0341661b3db9fc2f557b6b4186d5193671371d /xmake/modules/core/tools/cparser.lua
parentc97ee9d0ba48ac615caa9f239436645bc2e0af5a (diff)
parent3d72809db048911efec3d52106dd6968349ef4d1 (diff)
Merge pull request #563 from xmake-io/buildrules
Separate build rules for specific language files from action/build
Diffstat (limited to 'xmake/modules/core/tools/cparser.lua')
-rw-r--r--xmake/modules/core/tools/cparser.lua34
1 files changed, 2 insertions, 32 deletions
diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua
index 80b903949..a07f8e172 100644
--- a/xmake/modules/core/tools/cparser.lua
+++ b/xmake/modules/core/tools/cparser.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)
@@ -56,12 +56,6 @@ function init(self)
, ["-s"] = "-s"
, ["-S"] = "-S"
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the strip flag
@@ -157,31 +151,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