summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/scanner.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-08-19 10:59:05 +0800
committerGitHub <[email protected]>2025-08-19 10:59:05 +0800
commitc31cd67e1815e37620a1b8b252240d5dbbc1ed85 (patch)
tree08b139dda7dbdc9095d2c77e66704ffa5833db79 /xmake/rules/c++/modules/scanner.lua
parent56eaa5721cb8408013ebde1d95b84a3b3872d9d7 (diff)
parentde2dd38726f49b8bdedd17641486a3d3a39907aa (diff)
Merge pull request #6712 from Arthapz/fix-moduleonly-installation
fix(c++ modules) fix disabled target getting configured for module compilation
Diffstat (limited to 'xmake/rules/c++/modules/scanner.lua')
-rw-r--r--xmake/rules/c++/modules/scanner.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua
index 294d73e21..fa2c3b98b 100644
--- a/xmake/rules/c++/modules/scanner.lua
+++ b/xmake/rules/c++/modules/scanner.lua
@@ -507,7 +507,6 @@ function _do_computedag(target, modules, sourcebatch)
localcache:save()
end
profiler.leave(target:fullname(), "c++ modules", "scanner", "compute dag")
- -- jobgraph:dump()
end
function _do_scan(target, sourcefile, opt)
@@ -879,7 +878,7 @@ end
function get_modules(target)
local modules = support.localcache():get2(target:fullname(), "c++.modules")
- assert(modules, "no modules!")
+ assert(modules, "no modules! (" .. target:fullname() .. ")")
return modules
end
@@ -914,6 +913,12 @@ function main(target, jobgraph, sourcebatch)
profiler.enter(target:fullname(), "c++ modules", "scanner", "scan")
local compile_commands = os.getenv("XMAKE_IN_PROJECT_GENERATOR") and os.getenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR")
if target:data("cxx.has_modules") and (not os.getenv("XMAKE_IN_PROJECT_GENERATOR") or compile_commands) then
+ local memcache = support.memcache()
+ local targets = memcache:get("targets") or {}
+ targets[target:fullname()] = {}
+ targets[target:fullname()].finished_parsing = false
+ memcache:set("targets", targets)
+
_patch_sourcebatch(target, sourcebatch)
_schedule_module_dependencies_scan(target, jobgraph, sourcebatch)
end