summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-06 23:08:20 +0800
committerruki <[email protected]>2025-10-06 23:08:20 +0800
commit906d3f9c3f803a619cf6f3b3408d7420ae2a71e7 (patch)
tree0f76ac23d0d3e069c2277b36da3788456b304d2e /xmake/modules
parentd39631cdeee85cd98e3f5e54d80401c4d26b764c (diff)
enable remote only for distcc
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/async/runjobs.lua10
-rw-r--r--xmake/modules/private/action/build/target.lua8
2 files changed, 13 insertions, 5 deletions
diff --git a/xmake/modules/async/runjobs.lua b/xmake/modules/async/runjobs.lua
index e9d3a0c23..e43286a13 100644
--- a/xmake/modules/async/runjobs.lua
+++ b/xmake/modules/async/runjobs.lua
@@ -338,9 +338,13 @@ function main(name, jobs, opt)
if distcc then
state.distcc_semaphore = scheduler.co_semaphore(state.group_name .. "/distcc", 0)
end
- local local_comax = math.min(state.total, state.comax)
- for id = 1, local_comax do
- scheduler.co_start_withopt({name = name .. '/' .. tostring(id), isolate = opt.isolate}, _consume_jobs_loop, state, false)
+ -- @note we can set `remote_only = true` to run all jobs in remote only
+ local local_comax = 0
+ if not opt.remote_only then
+ local_comax = math.min(state.total, state.comax)
+ for id = 1, local_comax do
+ scheduler.co_start_withopt({name = name .. '/' .. tostring(id), isolate = opt.isolate}, _consume_jobs_loop, state, false)
+ end
end
if distcc then
local left_comax = state.total - local_comax
diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua
index c8a7987d5..ccb3d2924 100644
--- a/xmake/modules/private/action/build/target.lua
+++ b/xmake/modules/private/action/build/target.lua
@@ -788,7 +788,9 @@ function run_targetjobs(targets_root, opt)
if errors and progress.showing_without_scroll() then
print("")
end
- end, comax = opt.jobs or option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor})
+ end,
+ comax = opt.jobs or option.get("jobs") or 1, curdir = curdir,
+ distcc = opt.distcc, remote_only = opt.remote_only, progress_factor = opt.progress_factor})
os.cd(curdir)
return true
end
@@ -806,7 +808,9 @@ function run_filejobs(targets_root, opt)
if errors and progress.showing_without_scroll() then
print("")
end
- end, comax = opt.jobs or option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor})
+ end,
+ comax = opt.jobs or option.get("jobs") or 1, curdir = curdir,
+ distcc = opt.distcc, remote_only = opt.remote_only, progress_factor = opt.progress_factor})
os.cd(curdir)
return true
end