summaryrefslogtreecommitdiff
path: root/xmake/modules/private/service/distcc_build/client.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-19 00:29:15 +0800
committerruki <[email protected]>2022-05-19 00:29:15 +0800
commit05eff25304b1a440b481fc71ec2dcb082be98e4f (patch)
tree5d7ded42e0c235618db7722418e6f7e42097268e /xmake/modules/private/service/distcc_build/client.lua
parent17db46f7afecc8dce915b4440ed1461b19325974 (diff)
fix preprocessor
Diffstat (limited to 'xmake/modules/private/service/distcc_build/client.lua')
-rw-r--r--xmake/modules/private/service/distcc_build/client.lua37
1 files changed, 19 insertions, 18 deletions
diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua
index 7e8f46b6f..e4ade5c13 100644
--- a/xmake/modules/private/service/distcc_build/client.lua
+++ b/xmake/modules/private/service/distcc_build/client.lua
@@ -232,25 +232,26 @@ function distcc_build_client:compile(program, argv, opt)
-- do preprocess
opt = opt or {}
local preprocess = assert(opt.preprocess, "preprocessor not found!")
- local outdata, errdata, sourcefile, objectfile, cppfile, cppflags = preprocess(program, argv, opt)
-
- -- 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)
- local objectfile_cached = build_cache.get(cachekey)
- if objectfile_cached then
- os.cp(objectfile_cached, objectfile)
- cached = true
+ local ok, sourcefile, objectfile, cppfile, cppflags = preprocess(program, argv, opt)
+ if ok 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)
+ local objectfile_cached = build_cache.get(cachekey)
+ if objectfile_cached then
+ os.cp(objectfile_cached, objectfile)
+ cached = true
+ end
end
- end
- -- do distcc compilation
- if not cached then
- session:compile(sourcefile, objectfile, cppfile, cppflags, opt)
- if cachekey then
- build_cache.put(cachekey, objectfile)
+ -- do distcc compilation
+ if not cached then
+ session:compile(sourcefile, objectfile, cppfile, cppflags, opt)
+ if cachekey then
+ build_cache.put(cachekey, objectfile)
+ end
end
end
@@ -259,7 +260,7 @@ function distcc_build_client:compile(program, argv, opt)
-- unlock this host
self:_host_status_unlock(host)
- return outdata, errdata
+ return ok
end
-- get the status