summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)