summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChi Huu Huynh <[email protected]>2023-11-26 09:28:10 +0000
committerChi Huu Huynh <[email protected]>2023-11-26 09:28:10 +0000
commit44c72b4b92b96334f49adecdb1c8d883e371b044 (patch)
tree3b61ff430dc78617910f55fd5b4090bf6b4a92a1
parentf572dfe725f95902adb9a8a36d7a3ea485e2fd19 (diff)
Fix deps
-rw-r--r--xmake/rules/protobuf/proto.lua20
1 files changed, 12 insertions, 8 deletions
diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua
index e9f16d7c9..b34ca2f63 100644
--- a/xmake/rules/protobuf/proto.lua
+++ b/xmake/rules/protobuf/proto.lua
@@ -277,28 +277,32 @@ function build_cxfiles(target, batchjobs, sourcebatch, opt, sourcekind)
opt = opt or {}
local nodes = {}
+ local nodenames = {}
local node_rulename = "rules/" .. sourcebatch.rulename .. "/node"
- local rootname = "rules/" .. sourcebatch.rulename .. "/root"
- nodes[rootname] = {
- name = rootname,
- job = batchjobs:addjob(rootname, function(_index, _total)
- build_cxfile_objects(target, batchjobs, opt, sourcekind)
- end)
- }
local sourcefiles = sourcebatch.sourcefiles
for _, sourcefile_proto in ipairs(sourcefiles) do
local nodename = node_rulename .. "/" .. sourcefile_proto
nodes[nodename] = {
name = nodename,
- deps = {rootname},
job = batchjobs:addjob(nodename, function(index, total)
local batchcmds_ = batchcmds.new({target = target})
buildcmd_pfiles(target, batchcmds_, sourcefile_proto, {progress = (index * 100) / total}, sourcekind)
batchcmds_:runcmds({changed = target:is_rebuilt(), dryrun = option.get("dry-run")})
end)
}
+ table.insert(nodenames, nodename)
end
+
+ local rootname = "rules/" .. sourcebatch.rulename .. "/root"
+ nodes[rootname] = {
+ name = rootname,
+ deps = nodenames,
+ job = batchjobs:addjob(rootname, function(_index, _total)
+ build_cxfile_objects(target, batchjobs, opt, sourcekind)
+ end)
+ }
+
buildjobs(nodes, batchjobs, opt.rootjob)
end