diff options
| author | ruki <[email protected]> | 2024-04-09 00:53:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-09 00:53:24 +0800 |
| commit | 4cec4f287fbd9c2aae38ac4b08bdb86ba482ef15 (patch) | |
| tree | b4827fa6148473c7edcabcbfd31fa7547cb20023 /xmake/rules/c++/modules/modules_support | |
| parent | 73abaaf1db8d884ccc1eccff2cef4f17a38fcf72 (diff) | |
format code
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/builder.lua | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/xmake/rules/c++/modules/modules_support/builder.lua b/xmake/rules/c++/modules/modules_support/builder.lua index c56ac0731..af79e8046 100644 --- a/xmake/rules/c++/modules/modules_support/builder.lua +++ b/xmake/rules/c++/modules/modules_support/builder.lua @@ -80,30 +80,29 @@ end -- check if flags are compatible for module reuse function _are_flags_compatible(target, other, cppfile) - local compinst1 = target:compiler("cxx") - local flags1 = compinst1:compflags({sourcefile = cppfile, target = target}) + local compinst1 = target:compiler("cxx") + local flags1 = compinst1:compflags({sourcefile = cppfile, target = target}) - local compinst2 = other:compiler("cxx") - local flags2 = compinst2:compflags({sourcefile = cppfile, target = other}) + local compinst2 = other:compiler("cxx") + local flags2 = compinst2:compflags({sourcefile = cppfile, target = other}) - -- strip unrelevent flags - flags1 = compiler_support.strip_flags(target, flags1) - flags2 = compiler_support.strip_flags(target, flags2) + -- strip unrelevent flags + flags1 = compiler_support.strip_flags(target, flags1) + flags2 = compiler_support.strip_flags(target, flags2) - if #flags1 ~= #flags2 then - return false - end - - table.sort(flags1) - table.sort(flags2) + if #flags1 ~= #flags2 then + return false + end - for i = 1, #flags1 do - if flags1[i] ~= flags2[i] then - return false - end - end + table.sort(flags1) + table.sort(flags2) - return true + for i = 1, #flags1 do + if flags1[i] ~= flags2[i] then + return false + end + end + return true end -- try to reuse modules from other target |
