-
Notifications
You must be signed in to change notification settings - Fork 358
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
Include directories should be set to SYSTEM if not stand-alone #833
Comments
Note: If you agree that this is desirable, I could create a PR for this |
I think this would be of interest. |
Krzmbrzl
added a commit
to Krzmbrzl/CLI11
that referenced
this issue
Feb 9, 2023
When including CLI11 in a separate project (e.g. via FetchContent) cmake will now mark the CLI11 include files as system includes, which prevents compilers from issuing any warnings for stuff it found inside these headers. This makes sure that downstream users are not confronted with potential warning messages from CLI11, regardless of what kind of obscure warnings they might have enabled for their projects. Fixes CLIUtils#833
phlptp
pushed a commit
that referenced
this issue
Feb 10, 2023
When including CLI11 in a separate project (e.g. via FetchContent) cmake will now mark the CLI11 include files as system includes, which prevents compilers from issuing any warnings for stuff it found inside these headers. This makes sure that downstream users are not confronted with potential warning messages from CLI11, regardless of what kind of obscure warnings they might have enabled for their projects. Fixes #833
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If CLI11 is not built as a standalone library, but instead as part of another project (e.g. via submodule or via cmake's FetchContent)
target_include_directories
should make use of theSYSTEM
option. This will have the effect that the compiler will not emit any warnings for these include files, even if included in files for which the warning settings would normally cause a warning to be emitted.So as a trivial example, if in your header you somewhere had
and I compile my project with
-Wsign-conversion
, I get a warning for this line in your header, if I include that in my source file (for which that warning applies). Marking the CLI11 headers as "system headers" will make the compiler silently ignore that warning - which seems to be what downstream users want...The text was updated successfully, but these errors were encountered: