summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/actions/build/target_utils.lua7
-rw-r--r--xmake/modules/async/jobgraph.lua5
2 files changed, 12 insertions, 0 deletions
diff --git a/xmake/actions/build/target_utils.lua b/xmake/actions/build/target_utils.lua
index 3edf9f42b..9529fd490 100644
--- a/xmake/actions/build/target_utils.lua
+++ b/xmake/actions/build/target_utils.lua
@@ -287,9 +287,16 @@ function add_targetjobs_and_deps(jobgraph, target, targetrefs, opt)
if not targetrefs[targetname] then
targetrefs[targetname] = target
add_targetjobs(jobgraph, target, opt)
+
+ local linkjob = target:fullname() .. "/link_objects"
for _, depname in ipairs(target:get("deps")) do
local dep = project.target(depname, {namespace = target:namespace()})
add_targetjobs_and_deps(jobgraph, dep, targetrefs, opt)
+
+ local linkjob_dep = dep:fullname() .. "/link_objects"
+ if jobgraph:has(linkjob) and jobgraph:has(linkjob_dep) then
+ jobgraph:add_orders(linkjob_dep, linkjob)
+ end
end
end
end
diff --git a/xmake/modules/async/jobgraph.lua b/xmake/modules/async/jobgraph.lua
index 28126757f..612ff4882 100644
--- a/xmake/modules/async/jobgraph.lua
+++ b/xmake/modules/async/jobgraph.lua
@@ -107,6 +107,11 @@ function jobgraph:remove(name)
end
end
+-- has the given job or group?
+function jobgraph:has(name)
+ return self._jobs[name] or self._groups[name]
+end
+
-- enter group to add jobs
--
-- e.g.