summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-06 23:45:24 +0800
committerruki <[email protected]>2025-10-06 23:45:24 +0800
commitedc09f52065f0a2bda35b21b82299b00d9061b1e (patch)
treea4609e0032577f08863c3875ff754322fe440ae6
parent906d3f9c3f803a619cf6f3b3408d7420ae2a71e7 (diff)
improve remote only for distcc
-rw-r--r--xmake/modules/private/service/distcc_build/client.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua
index eff0e7727..e53e5b361 100644
--- a/xmake/modules/private/service/distcc_build/client.lua
+++ b/xmake/modules/private/service/distcc_build/client.lua
@@ -25,6 +25,7 @@ import("core.base.socket")
import("core.base.option")
import("core.base.scheduler")
import("core.project.policy")
+import("core.project.project")
import("core.project.config", {alias = "project_config"})
import("lib.detect.find_tool")
import("private.service.client_config", {alias = "config"})
@@ -262,7 +263,7 @@ function distcc_build_client:compile(program, argv, opt)
-- do distcc compilation
if not cached then
-- we just compile the large preprocessed file in remote
- if os.filesize(cppinfo.cppfile) > 4096 and not session:is_unreachable() then
+ if (self:remote_only() or os.filesize(cppinfo.cppfile) > 4096) and not session:is_unreachable() then
local compile_fallback = opt.compile_fallback
if compile_fallback then
local ok = try
@@ -391,6 +392,11 @@ function distcc_build_client:workdir()
return self._WORKDIR
end
+-- build on only remote machines
+function distcc_build_client:remote_only()
+ return project.policy("build.distcc.remote_only") == true
+end
+
-- get free host
function distcc_build_client:_get_freehost()
local max_weight = -1