diff options
| author | ruki <[email protected]> | 2025-04-21 13:03:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-21 13:03:53 +0800 |
| commit | 0f20ce8e8e6c5cc9a69251c57c97eb310236f862 (patch) | |
| tree | ef1aec265b16492717928018f35e57337c2032c0 | |
| parent | 104b36dff220ae0705c8287185ef372a3ab322c8 (diff) | |
| parent | c780bba3ebc6cea5386b15ec4744e66bb9fb3263 (diff) | |
Merge pull request #6342 from xmake-io/headerunits
fix detect -fmodule-header for gcc
| -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 |
