summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-14 14:44:51 +0800
committerGitHub <[email protected]>2025-05-14 14:44:51 +0800
commita68eff4a47e81b8ea430ee4f4a86d1fd8ccc7df9 (patch)
treec0dd102305af8f462c5fcf22af5fa5fe6a937b32 /xmake/rules/c++/modules
parent29ee4b47144829d80fbb7c3fe429696fba94394c (diff)
parentbb8609c50ec1d82c50af24455ab904c4f0b7cd27 (diff)
Merge pull request #6435 from Arthapz/fix-namespaced-module-dep
(C++ modules support) fix _patch_sourcebatch when target and deps is in the same namespace
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/scanner.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua
index 263b5725a..fe9b9c63d 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, "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