summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/scanner.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-05-22 08:51:48 +0200
committerArthur LAURENT <[email protected]>2025-05-22 08:51:48 +0200
commit481ada9f541be6754801d36bd03c84e7b8665b58 (patch)
tree951bba94cd5c7cb82b5d0239b1415fc26dccfdc4 /xmake/rules/c++/modules/scanner.lua
parent42ba909a17dd780a8bf1ba51a8fcd05ad9418ebd (diff)
(C++ modules support) fix clang-cl
Diffstat (limited to 'xmake/rules/c++/modules/scanner.lua')
-rw-r--r--xmake/rules/c++/modules/scanner.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua
index 9e95f3cfd..537fb91d9 100644
--- a/xmake/rules/c++/modules/scanner.lua
+++ b/xmake/rules/c++/modules/scanner.lua
@@ -389,7 +389,12 @@ function _patch_sourcebatch(target, sourcebatch)
local can_reuse = nocheck or _are_flags_compatible(target, dep, sourcefile, {strict = strict})
if can_reuse then
- support.set_reused(target, dep, sourcefile)
+ local _reused, from = support.is_reused(dep, sourcefile)
+ if _reused then
+ support.set_reused(target, from, sourcefile)
+ else
+ support.set_reused(target, dep, sourcefile)
+ end
table.insert(reused, sourcefile)
if dep:is_moduleonly() then
dep:data_set("cxx.modules.reused", true)
@@ -417,10 +422,15 @@ function _patch_sourcebatch(target, sourcebatch)
if reused:has(sourcefile) then
local dep = target:dep(fileconfig.external)
assert(dep, "dep target <%s> for <%s> not found", fileconfig.external, target:fullname())
+ local _reused, from = support.is_reused(dep, sourcefile)
+ if _reused then
+ support.set_reused(target, from, sourcefile)
+ else
+ support.set_reused(target, dep, sourcefile)
+ end
if dep:is_moduleonly() then
dep:data_set("cxx.modules.reused", true)
end
- support.set_reused(target, dep, sourcefile)
end
target:fileconfig_add(sourcefile, fileconfig)
end