diff options
| author | ruki <[email protected]> | 2025-05-22 22:05:30 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-22 22:05:30 +0800 |
| commit | 9d6f52f4eda17ce1dfe69b86a6fa990d75a4a653 (patch) | |
| tree | a925ea8271178b9e93da13e7b01e47884a4a2154 /xmake/rules/c++/modules/scanner.lua | |
| parent | d558ace9f0d9daa3c51d3ac6b56147a67e995149 (diff) | |
| parent | 481ada9f541be6754801d36bd03c84e7b8665b58 (diff) | |
Merge pull request #6477 from Arthapz/fix-clang-cl-modules
(C++ modules support) fix clang cl module support
Diffstat (limited to 'xmake/rules/c++/modules/scanner.lua')
| -rw-r--r-- | xmake/rules/c++/modules/scanner.lua | 14 |
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 |
