-
Notifications
You must be signed in to change notification settings - Fork 94
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
CI: Enable -Werror for clazy since we're warning clean now #307
Conversation
We're now clazy free and can make clazy use -Werror in CI
CMakeLists.txt
Outdated
@@ -74,6 +74,7 @@ option(${PROJECT_NAME}_TESTS "Build the tests" OFF) | |||
option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON) | |||
option(${PROJECT_NAME}_DOCS "Build the API documentation" OFF) | |||
option(${PROJECT_NAME}_QT6 "Build against Qt 6" ON) | |||
option(${PROJECT_NAME}_WERROR "Treat build warnings as errors" OFF) |
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.
CMake provides a builtin option for that already: CMAKE_COMPILE_WARNING_AS_ERROR
I learned that very recently in https://codereview.kdab.com/c/training-material/+/151437
Should we just document to use that instead?
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.
good idea
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.
the preset serves as documentation
CMakeLists.txt
Outdated
# it doesn't mean we endorse those warnings. | ||
# MSVC Werror is untested and probably will have a few hundered errors | ||
if(MSVC) | ||
add_compile_options(/WX) |
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.
This can be removed, the cmake option takes care of that
Modules/Compiler/MSVC.cmake:13: set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-WX")
While this is only being used for clazy now we could also enable it in CI for regular builds
No description provided.