diff options
| author | ruki <[email protected]> | 2022-05-19 00:51:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-19 00:51:20 +0800 |
| commit | 0bb56c9a4efc55c6f478b49340607cb651656159 (patch) | |
| tree | a1d984d0f496db60a19a52712821b991e4321ab2 /xmake/modules/private | |
| parent | d3b2139aacaf4efba9f47e16f36d6086f9e5544b (diff) | |
improve preprocess
Diffstat (limited to 'xmake/modules/private')
| -rw-r--r-- | xmake/modules/private/service/distcc_build/client.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua index e4ade5c13..80b92ab63 100644 --- a/xmake/modules/private/service/distcc_build/client.lua +++ b/xmake/modules/private/service/distcc_build/client.lua @@ -232,25 +232,25 @@ function distcc_build_client:compile(program, argv, opt) -- do preprocess opt = opt or {} local preprocess = assert(opt.preprocess, "preprocessor not found!") - local ok, sourcefile, objectfile, cppfile, cppflags = preprocess(program, argv, opt) - if ok then + local cppinfo = preprocess(program, argv, opt) + if cppinfo then -- get objectfile from the build cache first local cached = false local cachekey if build_cache.is_enabled() then - cachekey = build_cache.cachekey(program, cppfile, cppflags, opt.envs) + cachekey = build_cache.cachekey(program, cppinfo.cppfile, cppinfo.cppflags, opt.envs) local objectfile_cached = build_cache.get(cachekey) if objectfile_cached then - os.cp(objectfile_cached, objectfile) + os.cp(objectfile_cached, cppinfo.objectfile) cached = true end end -- do distcc compilation if not cached then - session:compile(sourcefile, objectfile, cppfile, cppflags, opt) + session:compile(cppinfo.sourcefile, cppinfo.objectfile, cppinfo.cppfile, cppinfo.cppflags, opt) if cachekey then - build_cache.put(cachekey, objectfile) + build_cache.put(cachekey, cppinfo.objectfile) end end end @@ -260,7 +260,7 @@ function distcc_build_client:compile(program, argv, opt) -- unlock this host self:_host_status_unlock(host) - return ok + return cppinfo end -- get the status |
