summaryrefslogtreecommitdiff
path: root/xmake/modules/private
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-13 23:49:04 +0800
committerruki <[email protected]>2022-05-13 23:49:04 +0800
commit2ff45f35b6e2c68ef4e9b84374e46bd8a204d4d2 (patch)
tree709ae7b420af0ed25c4758d5b812776e88903b69 /xmake/modules/private
parentced902127370a7d81cc563b4d4079cb34ff18ff8 (diff)
mark distcc-able jobs
Diffstat (limited to 'xmake/modules/private')
-rw-r--r--xmake/modules/private/action/build/object.lua2
-rw-r--r--xmake/modules/private/async/jobpool.lua10
2 files changed, 7 insertions, 5 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index e07ab76b7..3d68dcfa2 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -114,6 +114,6 @@ function main(target, batchjobs, sourcebatch, opt)
batchjobs:addjob(sourcefile, function (index, total)
local build_opt = table.join({objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = (index * 100) / total}, opt)
build_object(target, sourcefile, build_opt)
- end, {rootjob = rootjob})
+ end, {rootjob = rootjob, distcc = opt.distcc})
end
end
diff --git a/xmake/modules/private/async/jobpool.lua b/xmake/modules/private/async/jobpool.lua
index 458b8802d..dfcf2b6d5 100644
--- a/xmake/modules/private/async/jobpool.lua
+++ b/xmake/modules/private/async/jobpool.lua
@@ -43,8 +43,9 @@ end
-- jobpool:add(job, rootjob2)
-- jobpool:add(job, rootjob3)
--
-function jobpool:newjob(name, run)
- return {name = name, run = run}
+function jobpool:newjob(name, run, opt)
+ opt = opt or {}
+ return {name = name, run = run, distcc = opt.distcc}
end
-- add run job to the given job node
@@ -54,11 +55,12 @@ end
--
-- @param name the job name
-- @param run the run command/script
--- @param opt the options (rootjob)
+-- @param opt the options (rootjob, distcc)
+-- we can support distcc build if distcc is true
--
function jobpool:addjob(name, run, opt)
opt = opt or {}
- return self:add({name = name, run = run}, opt.rootjob)
+ return self:add({name = name, run = run, distcc = opt.distcc}, opt.rootjob)
end
-- add job to the given job node