diff options
| author | ruki <[email protected]> | 2025-04-21 22:56:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-21 22:56:26 +0800 |
| commit | c780bba3ebc6cea5386b15ec4744e66bb9fb3263 (patch) | |
| tree | a5fd090915bb1a9114bbdcc334b364e5e1ac5063 /xmake/rules/c++ | |
| parent | 5d999522fe625c54a572fcdd28bc82f2850a3d5a (diff) | |
fix detect -fmodule-header for gccheaderunits
Diffstat (limited to 'xmake/rules/c++')
| -rw-r--r-- | xmake/rules/c++/modules/gcc/support.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua index 264195874..52d8af79f 100644 --- a/xmake/rules/c++/modules/gcc/support.lua +++ b/xmake/rules/c++/modules/gcc/support.lua @@ -208,8 +208,11 @@ end function get_moduleheaderflag(target) local moduleheaderflag = _g.moduleheaderflag if moduleheaderflag == nil then + -- we need to suppress warnings/errors: + -- external linkage definition of 'int main(int, char**)' in header module must be declared 'inline' + local snippet = "" local compinst = target:compiler("cxx") - if compinst:has_flags("-fmodule-header", "cxxflags", {flagskey = "gcc_module_header"}) then + if compinst:has_flags("-fmodule-header", "cxxflags", {snippet = snippet, flagskey = "gcc_module_header"}) then moduleheaderflag = "-fmodule-header=" end _g.moduleheaderflag = moduleheaderflag or false |
