diff options
| author | Arthur LAURENT <[email protected]> | 2025-11-04 12:36:33 +0100 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2025-11-04 12:36:33 +0100 |
| commit | ce723897432dad8d8f94ddf831e3a8d7db6e2700 (patch) | |
| tree | 2f2b90ec77ff0cf6093f2e534e69d9e9eda116dc /xmake/rules/c++/modules/builder.lua | |
| parent | 791bb25721f76b49b384b6f8657bac7660036b4a (diff) | |
fix module reusage with xmake test
Diffstat (limited to 'xmake/rules/c++/modules/builder.lua')
| -rw-r--r-- | xmake/rules/c++/modules/builder.lua | 11 |
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 - |
