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
Enable compiler warnings. #1792
Conversation
Should we provide separate PR into master and then rebase this PR or how did you imagine to go about solving the produced errors? |
Someone more daring than me should pick a method. 😁 |
Why might want to update the minimum required version to at least 3.15 or work around this bug: https://gitlab.kitware.com/cmake/cmake/-/issues/18317 Otherwise we'll get a lot of complaints about this warning. 😅 |
a624063
to
84f69b4
Compare
Should be fixed with the |
I think it makes the most sense if people would make PRs onto this branch, otherwise they don't actually see whether they've fixed all the issues. |
84f69b4
to
1c03786
Compare
Pushed changeset without |
1c03786
to
6a9fd59
Compare
Added |
endif() | ||
|
||
foreach(WARNING ${FILE_WARNINGS}) | ||
set_property(SOURCE ${ARGV} APPEND_STRING PROPERTY COMPILE_FLAGS " ${WARNING}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use set_source_files_properties
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_property
lets us append to the existing property value in a single line.
# https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md | ||
|
||
# Helper function to enable compiler warnings for a specific set of files | ||
function(set_file_warnings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason we set the options on a set of files rather than on the targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can select precisely for which files we want to enable our strict warnings (which are treated as errors and cause building to fail). There might be cases where we choose to compile some third party source as part of a target and don't want to enable our warnings for upstream code.
6a9fd59
to
7749f3e
Compare
Removed |
Superseded, integrated and merged in #1846 |
Title says it all.
Currently not expected to build since the enabled warnings are stricter than the current requirements on the code.