Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "SYSTEM" from the include_directories() CMakeLists.txt entries. #557

Closed
madscientist42 opened this issue Sep 6, 2019 · 1 comment

Comments

@madscientist42
Copy link

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.

@Code7R
Copy link
Contributor

Code7R commented Sep 9, 2019

Oh yes, please!!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants