diff options
| author | ruki <[email protected]> | 2022-06-16 23:58:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-06-16 23:58:42 +0800 |
| commit | 618e06bdbf3e588916ae523e65e1de9e65c10fd3 (patch) | |
| tree | e618f115abca7783d3e80658593eb80d312874e5 /xmake/modules/core | |
| parent | cc1caaa566b08212d484eb2565e671c418789110 (diff) | |
add compile fallback for cl/ccache
Diffstat (limited to 'xmake/modules/core')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 6c558ce6b..d736c0ad2 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -502,22 +502,27 @@ end -- do compile function _compile(self, sourcefile, objectfile, compflags, opt) + local function _compile_fallback() + local program, argv = compargv(self, sourcefile, objectfile, compflags, opt) + local outdata, errdata = vstool.iorunv(program, argv, {envs = self:runenvs()}) + return outdata, errdata + end local cppinfo if distcc_build_client.is_distccjob() and distcc_build_client.singleton():has_freejobs() then local program, argv = compargv(self, sourcefile, objectfile, compflags, table.join(opt, {rawargs = true})) cppinfo = distcc_build_client.singleton():compile(program, argv, {envs = self:runenvs(), - preprocess = _preprocess, compile = _compile_preprocessed_file, target = opt.target, tool = self, remote = true}) + preprocess = _preprocess, compile = _compile_preprocessed_file, compile_fallback = _compile_fallback, + target = opt.target, tool = self, remote = true}) elseif build_cache.is_enabled() and build_cache.is_supported(self:kind()) then local program, argv = compargv(self, sourcefile, objectfile, compflags, table.join(opt, {rawargs = true})) cppinfo = build_cache.build(program, argv, {envs = self:runenvs(), - preprocess = _preprocess, compile = _compile_preprocessed_file, target = opt.target, tool = self}) + preprocess = _preprocess, compile = _compile_preprocessed_file, compile_fallback = _compile_fallback, + target = opt.target, tool = self}) end if cppinfo then return cppinfo.outdata, cppinfo.errdata else - local program, argv = compargv(self, sourcefile, objectfile, compflags, opt) - local outdata, errdata = vstool.iorunv(program, argv, {envs = self:runenvs()}) - return outdata, errdata + return _compile_fallback() end end |
