diff options
| author | ruki <[email protected]> | 2022-08-24 23:34:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-24 23:34:08 +0800 |
| commit | a77e6df407c6b411d73f3c129db02526c3cdac32 (patch) | |
| tree | 3076fd362d6dbffde4fabb778acc82b1f3886fe0 /xmake/rules/c++/modules/modules_support | |
| parent | f029d068cd8d7f508cafd7fc050c1738350b114c (diff) | |
remove repeat moduledeps
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 1e3231231..92c92d465 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -384,6 +384,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile) local module_name_export local module_name_private local module_deps = {} + local module_deps_set = hashset.new() local sourcecode = io.readfile(sourcefile) sourcecode = sourcecode:gsub("//.-\n", "\n") sourcecode = sourcecode:gsub("/%*.-%*/", "") @@ -400,7 +401,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile) if not module_depname and not has_module_extension(sourcefile) then module_depname = module_name_private end - if module_depname then + if module_depname and not module_deps_set:has(module_depname) then local module_dep = {} -- partition? import :xxx; if module_depname:startswith(":") then @@ -418,6 +419,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile) end module_dep["logical-name"] = module_depname table.insert(module_deps, module_dep) + module_deps_set:insert(module_depname) end end |
