diff options
| author | Arthur LAURENT <[email protected]> | 2022-12-06 18:54:21 +0100 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-12-06 18:54:30 +0100 |
| commit | 36b847657952d6f3d97ba827a4d1dc8fe9163c8b (patch) | |
| tree | e737d9d794053b227432a82fa37c9954f4f3f59c /xmake/rules/c++/modules | |
| parent | ea9ea2d31ec34c55e1968484efe4f5413116adc4 (diff) | |
Ensure module import order on Clang
Diffstat (limited to 'xmake/rules/c++/modules')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/clang.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index 9cad5f2ff..adef57a4f 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -714,9 +714,16 @@ function get_requiresflags(target, requires) local flags = {} local modulemap = _get_modulemap_from_mapper(target) -- add deps required module flags + local already_mapped_modules = {} for name, _ in pairs(requires) do + -- if already in flags, continue + if already_mapped_modules[name] then + goto continue + end + for _, dep in ipairs(target:orderdeps()) do local modulemap_ = _get_modulemap_from_mapper(dep) + already_mapped_modules[name] = true if modulemap_[name] then table.join2(flags, modulemap_[name].flag) table.join2(flags, modulemap_[name].deps or {}) |
