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

Unify WarningFlags.cmake by checking if compiler supports warning flag #3042

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tobbi
Copy link
Member

@tobbi tobbi commented Aug 9, 2024

Instead of having different warning flags per compiler, check for each flag if the compiler supports it and then add it

@tobbi
Copy link
Member Author

tobbi commented Aug 9, 2024

#3029 for reference

@tobbi
Copy link
Member Author

tobbi commented Aug 9, 2024

https://www.foonathan.net/2018/10/cmake-warnings/

The trick is to use target_include_directories(my_library SYSTEM PUBLIC include/). The SYSTEM turns the include directory into a system include directory. Compilers will not issue warnings from header files originating from there.

@tobbi tobbi marked this pull request as draft August 9, 2024 23:57
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

Successfully merging this pull request may close these issues.

1 participant