summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-17 00:45:25 +0800
committerruki <[email protected]>2022-05-17 00:45:25 +0800
commit61719b2242a0ea7f0bc263b4012f02b8f5daf216 (patch)
tree0b2524ebcae68b8fe273869d080cbdd4c5260888
parent7da97c871974089e3ada1baad9544599f14bd423 (diff)
improve gcc/cl
-rw-r--r--xmake/modules/core/tools/cl.lua2
-rw-r--r--xmake/modules/core/tools/gcc.lua2
-rw-r--r--xmake/modules/private/service/distcc_build/client.lua5
3 files changed, 3 insertions, 6 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index bdb3d350f..b6769860d 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -448,7 +448,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
-- use vstool to compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528
local program, argv = compargv(self, sourcefile, objectfile, compflags, opt)
- if distcc_build_client.is_distccjob() then
+ if distcc_build_client.is_distccjob() and distcc_build_client.singleton():has_freejobs() then
return distcc_build_client.singleton():iorunv(program, argv, {envs = self:runenvs(), tool = self})
else
return vstool.iorunv(program, argv, {envs = self:runenvs()})
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 523d5fc5e..553ed9fb6 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -457,7 +457,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
-- do compile
local program, argv = compargv(self, sourcefile, objectfile, compflags)
- if distcc_build_client.is_distccjob() then
+ if distcc_build_client.is_distccjob() and distcc_build_client.singleton():has_freejobs() then
return distcc_build_client.singleton():iorunv(program, argv, {envs = self:runenvs(), tool = self})
else
return os.iorunv(program, argv, {envs = self:runenvs()})
diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua
index d3097c04d..deca085c0 100644
--- a/xmake/modules/private/service/distcc_build/client.lua
+++ b/xmake/modules/private/service/distcc_build/client.lua
@@ -220,10 +220,7 @@ end
function distcc_build_client:iorunv(program, argv, opt)
-- get free host
- local host = self:_get_freehost()
- if not host then
- return os.iorunv(program, argv, opt)
- end
+ local host = assert(self:_get_freehost(), "free host not found!")
-- lock this host
self:_host_status_lock(host)