diff options
| author | ruki <[email protected]> | 2022-05-14 00:56:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-14 00:56:39 +0800 |
| commit | 6b8299c79e6b8f1548f52b02295a03dcfeccd995 (patch) | |
| tree | 39082e7f320f8b8bbff1103c334932f64f8a87e0 /xmake/modules/core/tools/gcc.lua | |
| parent | 952c7a339855b32c83a9baaaa9e3f55929294fdf (diff) | |
wrap gcc to distcc
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 49184a1d2..c967d222e 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -28,6 +28,7 @@ import("core.project.project") import("core.language.language") import("private.tools.ccache") import("utils.progress") +import("private.service.distcc_build.client", {alias = "distcc_build_client"}) -- init it function init(self) @@ -456,7 +457,11 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) -- do compile local program, argv = compargv(self, sourcefile, objectfile, compflags) - return os.iorunv(program, argv, {envs = self:runenvs()}) + if distcc_build_client.is_connected() then + return distcc_build_client.singleton():iorunv(program, argv, {envs = self:runenvs()}) + else + return os.iorunv(program, argv, {envs = self:runenvs()}) + end end, catch { |
