You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you use SYSTEM in an include_directories directive in a CMake file, this causes CMake to generate an -isystem flag entry for that given directory. Per FSF, this changes the search order of things on the system search pathing so that #include_next <> does not work correctly in most contexts, including a cross-compile one.
The FSF explicitly states that -isystem should not be used for this purpose except very special cases (Typically the ones for GCC itself...) and you should use -I instead as it arrives at the desired goals in general without breaking the #include_next search behavior. Removing "SYSTEM" from the directives lets CMake use -I instead.
The text was updated successfully, but these errors were encountered:
I stumbled upon this stupid -isystem flag generation hack in some other projects already and it's a real mess. It might not be visible with an older compiler immediately but starting with gcc 7 or so it starts wreaking havoc unless patched by compiler integrator somewhere.
When you use SYSTEM in an include_directories directive in a CMake file, this causes CMake to generate an -isystem flag entry for that given directory. Per FSF, this changes the search order of things on the system search pathing so that #include_next <> does not work correctly in most contexts, including a cross-compile one.
The FSF explicitly states that -isystem should not be used for this purpose except very special cases (Typically the ones for GCC itself...) and you should use -I instead as it arrives at the desired goals in general without breaking the #include_next search behavior. Removing "SYSTEM" from the directives lets CMake use -I instead.
The text was updated successfully, but these errors were encountered: