From 1dcfa0d95ee2cbe521b707cec7e142d8706570ff Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Tue, 13 May 2025 20:21:51 +0200 Subject: (C++ modules support) fix _patch_sourcebatch when a dep have a namespace --- xmake/rules/c++/modules/scanner.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua index 263b5725a..d0d197ab4 100644 --- a/xmake/rules/c++/modules/scanner.lua +++ b/xmake/rules/c++/modules/scanner.lua @@ -296,7 +296,11 @@ function _get_targetdeps_modules(target) fileconfig.undefines = table.join(fileconfig.undefines or {}, dep:get("undefines") or {}) fileconfig.includedirs = table.join(fileconfig.includedirs or {}, dep:get("includedirs") or {}) if not dep:is_phony() then - fileconfig.external = dep:fullname() + if target:namespace() == dep:namespace() then + fileconfig.external = dep:name() + else + fileconfig.external = dep:fullname() + end fileconfig.bmionly = not dep:is_moduleonly() end if not modules[sourcefile] then @@ -358,6 +362,7 @@ function _patch_sourcebatch(target, sourcebatch) local strict = target:policy("build.c++.modules.reuse.strict") or target:policy("build.c++.modules.tryreuse.discriminate_on_defines") local dep = target:dep(fileconfig.external) + assert(dep, format("dep target <%s> for <%s>", fileconfig.external, target:fullname())) local can_reuse = nocheck or _are_flags_compatible(target, dep, sourcefile, {strict = strict}) if can_reuse then -- cgit v1.3.1