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

CI: Enable -Werror for clazy since we're warning clean now #307

Merged
merged 2 commits into from
Mar 3, 2025

Conversation

iamsergio
Copy link
Contributor

No description provided.

We're now clazy free and can make clazy use -Werror in CI
@iamsergio iamsergio requested a review from dfaure-kdab March 1, 2025 12:52
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)
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

Copy link
Contributor Author

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)
Copy link
Member

@dfaure-kdab dfaure-kdab Mar 3, 2025

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
@dfaure-kdab dfaure-kdab merged commit 31b8e24 into master Mar 3, 2025
27 checks passed
@dfaure-kdab dfaure-kdab deleted the clazy branch March 3, 2025 11:47
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.

2 participants