diff options
| author | ruki <[email protected]> | 2022-05-20 23:05:19 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-20 23:05:19 +0800 |
| commit | 6cf488d207c3009aba6319759a2cc2fb6aa7a405 (patch) | |
| tree | c61583cf363192611d4f0be291b9e1fbe8afd2ab /xmake/modules/core/tools/cparser.lua | |
| parent | c6218b9b4cd17babf15fa46dbc65e895ace3e7d7 (diff) | |
| parent | d63ce0e016b58d03519f957d7ac9f36494c73486 (diff) | |
Merge pull request #2361 from xmake-io/buildcache
Add build cache instead of ccache
Diffstat (limited to 'xmake/modules/core/tools/cparser.lua')
| -rw-r--r-- | xmake/modules/core/tools/cparser.lua | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua index a155b7fa2..0eb9847f0 100644 --- a/xmake/modules/core/tools/cparser.lua +++ b/xmake/modules/core/tools/cparser.lua @@ -23,7 +23,6 @@ import("core.base.option") import("core.project.config") import("core.project.project") import("core.language.language") -import("private.tools.ccache") -- init it function init(self) @@ -145,21 +144,17 @@ end -- link the target file function link(self, objectfiles, targetkind, targetfile, flags) - - -- ensure the target directory os.mkdir(path.directory(targetfile)) - - -- link it os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags)) end -- make the compile arguments list -function _compargv1(self, sourcefile, objectfile, flags) - return ccache.cmdargv(self:program(), table.join("-c", flags, "-o", objectfile, sourcefile)) +function compargv(self, sourcefile, objectfile, flags) + return self:program(), table.join("-c", flags, "-o", objectfile, sourcefile) end -- compile the source file -function _compile1(self, sourcefile, objectfile, dependinfo, flags) +function compile(self, sourcefile, objectfile, dependinfo, flags) -- ensure the object directory os.mkdir(path.directory(objectfile)) @@ -168,7 +163,7 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) try { function () - local outdata, errdata = os.iorunv(_compargv1(self, sourcefile, objectfile, flags)) + local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags)) return (outdata or "") .. (errdata or "") end, catch @@ -211,23 +206,3 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) } end --- make the compile arguments list -function compargv(self, sourcefiles, objectfile, flags) - - -- only support single source file now - assert(type(sourcefiles) ~= "table", "'object:sources' not support!") - - -- for only single source file - return _compargv1(self, sourcefiles, objectfile, flags) -end - --- compile the source file -function compile(self, sourcefiles, objectfile, dependinfo, flags) - - -- only support single source file now - assert(type(sourcefiles) ~= "table", "'object:sources' not support!") - - -- for only single source file - _compile1(self, sourcefiles, objectfile, dependinfo, flags) -end - |
