summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-04-09 00:45:04 +0800
committerruki <[email protected]>2025-04-09 00:45:04 +0800
commit117ae687a27f34cf183e967e8688eb3d7e8e4f81 (patch)
tree7fc96ddd9e8bc734579522fda94a22e436eebe2e /xmake/modules
parentbd6f305cd44634dd9829407d01749ae150a7b2d8 (diff)
compatible with order deps
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/build/target.lua6
-rw-r--r--xmake/modules/private/utils/rule.lua6
2 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua
index b6d428692..beb6f9cb2 100644
--- a/xmake/modules/private/action/build/target.lua
+++ b/xmake/modules/private/action/build/target.lua
@@ -223,6 +223,7 @@ function add_targetjobs_with_stage(jobgraph, target, stage, opt)
scriptcmd_name = scriptcmd_name
}
for _, instance in ipairs(instances) do
+ -- we need to use this group to sort rule scripts with add_orders
local script_group = group_name .. "/" .. instance:fullname()
jobgraph:group(script_group, function ()
if add_targetjobs_for_script(jobgraph, target, instance, script_opt) then
@@ -247,7 +248,7 @@ function add_targetjobs_with_stage(jobgraph, target, stage, opt)
end
-- sort build rules
- rule_utils.build_orders_in_jobgraph(jobgraph, instances, {root_group = group_name})
+ rule_utils.build_orders_in_jobgraph(jobgraph, target, instances, {root_group = group_name})
return group_name
end
@@ -526,6 +527,7 @@ function add_filejobs_with_stage(jobgraph, target, sourcebatches, stage, opt)
}
local has_target_script = false
for _, instance in ipairs(instances) do
+ -- we need to use this group to sort rule scripts with add_orders
local script_group = group_name .. "/" .. instance:fullname()
jobgraph:group(script_group, function ()
if instance == target then
@@ -552,7 +554,7 @@ function add_filejobs_with_stage(jobgraph, target, sourcebatches, stage, opt)
end
-- sort build rules
- rule_utils.build_orders_in_jobgraph(jobgraph, instances, {root_group = group_name})
+ rule_utils.build_orders_in_jobgraph(jobgraph, target, instances, {root_group = group_name})
return group_name
end
diff --git a/xmake/modules/private/utils/rule.lua b/xmake/modules/private/utils/rule.lua
index 531486f61..ed6aec451 100644
--- a/xmake/modules/private/utils/rule.lua
+++ b/xmake/modules/private/utils/rule.lua
@@ -46,7 +46,7 @@ end
-- end)
-- end
--
-function build_orders_in_jobgraph(jobgraph, rules, opt)
+function build_orders_in_jobgraph(jobgraph, target, rules, opt)
opt = opt or {}
local root_group = assert(opt.root_group)
for _, ruleinst in ipairs(rules) do
@@ -55,7 +55,9 @@ function build_orders_in_jobgraph(jobgraph, rules, opt)
for _, order in ipairs(orders) do
local joborders = {}
for _, rulename in ipairs(order) do
- local script_group = root_group .. "/" .. rulename
+ -- we need to use fullname to support namespace
+ local ruleinst = get_rule(target, rulename)
+ local script_group = root_group .. "/" .. ruleinst:fullname()
if jobgraph:has(script_group) then
table.insert(joborders, script_group)
end