summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/builder.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-11-04 12:36:33 +0100
committerArthur LAURENT <[email protected]>2025-11-04 12:36:33 +0100
commitce723897432dad8d8f94ddf831e3a8d7db6e2700 (patch)
tree2f2b90ec77ff0cf6093f2e534e69d9e9eda116dc /xmake/rules/c++/modules/builder.lua
parent791bb25721f76b49b384b6f8657bac7660036b4a (diff)
fix module reusage with xmake test
Diffstat (limited to 'xmake/rules/c++/modules/builder.lua')
-rw-r--r--xmake/rules/c++/modules/builder.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/builder.lua b/xmake/rules/c++/modules/builder.lua
index a1c93a35f..87cd143f0 100644
--- a/xmake/rules/c++/modules/builder.lua
+++ b/xmake/rules/c++/modules/builder.lua
@@ -121,13 +121,15 @@ function _get_jobdeps(target, module, jobgraph, buildfilejob)
return jobdeps
end
-function _get_saved_jobdeps_for(buildfilejob)
+function _get_saved_jobdeps_for(jobgraph, buildfilejob)
local memcache = support.memcache()
local dependent_jobs = memcache:get2("dependent_jobs", buildfilejob)
local jobdeps = {}
for _, dependent_job in ipairs(dependent_jobs) do
- jobdeps[dependent_job] = jobdeps[dependent_job] or {}
- table.insert(jobdeps[dependent_job], buildfilejob)
+ if jobgraph:has(dependent_job) then
+ jobdeps[dependent_job] = jobdeps[dependent_job] or {}
+ table.insert(jobdeps[dependent_job], buildfilejob)
+ end
end
return jobdeps
end
@@ -266,7 +268,7 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
-- insert saved jobdeps
for _, buildfilejob in ipairs(buildfilejobs) do
- table.join2(jobdeps, _get_saved_jobdeps_for(buildfilejob))
+ table.join2(jobdeps, _get_saved_jobdeps_for(jobgraph, buildfilejob))
end
-- apply jobdeps
@@ -756,4 +758,3 @@ function build_objectfiles(target, jobgraph, _, opt)
profiler.leave(target:fullname(), "c++ modules", "builder", "objectfiles")
end
end
-