Skip to content

Commit

Permalink
CI: Enable -Werror for clazy since we're warning clean now
Browse files Browse the repository at this point in the history
While this is only being used for clazy now we could also enable it in
CI for regular builds
  • Loading branch information
iamsergio authored and dfaure-kdab committed Mar 3, 2025
1 parent 51684ac commit 31b8e24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
)
endif()

if(CMAKE_COMPILE_WARNING_AS_ERROR)
# These -Wno-error flags are here to enable -Werror for clazy in CI
# it doesn't mean we endorse those warnings.
# MSVC is untested and probably will have a few hundered errors
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Wno-error=deprecated-declarations)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-error=documentation -Wno-error=unused-private-field -Wno-error=c++20-extensions)
endif()
endif()
endif()

if(${PROJECT_NAME}_QT6)
set(QT_VERSION_MAJOR 6)
set(QT_MIN_VERSION "6.0.0")
Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"inherits": "dev",
"cacheVariables": {
"KDSoap_EXAMPLES": "OFF",
"KDSoap_TESTS": "OFF"
"KDSoap_TESTS": "OFF",
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON"
},
"environment": {
"CXX": "clazy",
Expand Down

0 comments on commit 31b8e24

Please sign in to comment.