@@ -9,12 +9,6 @@ CheckOptions:
99 - { key: HeaderFileExtensions, value: 'x' }
1010" )
1111
12- # TODO: limit to target
13- add_compile_definitions ($<$<NOT :$<CONFIG:Debug>>:QT_NO_DEBUG>)
14- add_compile_definitions ($<$<NOT :$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
15- add_compile_definitions ($<$<NOT :$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
16- add_compile_definitions ($<$<CONFIG:Debug>:QT_DEBUG>)
17-
1812 file (GLOB hdrs "*.h" )
1913 file (GLOB srcs "*.cpp" )
2014 file (GLOB uis "*.ui" )
@@ -73,12 +67,25 @@ CheckOptions:
7367 endif ()
7468 endif ()
7569 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
76- # Q_UNUSED() in generated code
77- target_compile_options_safe(cppcheck-gui -Wno-extra-semi-stmt)
78- # caused by Qt generated moc code
79- target_compile_options_safe(cppcheck-gui -Wno-redundant-parens)
70+ if (QT_VERSION VERSION_LESS "6.0.0" )
71+ # Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
72+ target_compile_options_safe(cppcheck-gui -Wno-extra-semi-stmt)
73+ endif ()
74+ if (QT_VERSION VERSION_LESS "6.4.0" )
75+ # caused by Qt generated moc code - see https://bugreports.qt.io/browse/QTBUG-100915
76+ target_compile_options_safe(cppcheck-gui -Wno-redundant-parens)
77+ endif ()
8078 endif ()
81- #target_compile_definitions(cppcheck-gui PRIVATE -DQT_NO_QPAIR) # TODO: cannot be completely disabled because QBrush uses QPair
79+ if (QT_VERSION VERSION_GREATER_EQUAL "6.9.0" )
80+ # QBrush fails to compile before 6.9.0 - see https://bugreports.qt.io/browse/QTBUG-134038
81+ target_compile_definitions (cppcheck-gui PRIVATE -DQT_NO_QPAIR)
82+ endif ()
83+ target_compile_definitions (cppcheck-gui PRIVATE -DQT_NO_FOREACH)
84+
85+ target_compile_definitions (cppcheck-gui PRIVATE $<$<NOT :$<CONFIG:Debug>>:QT_NO_DEBUG>)
86+ target_compile_definitions (cppcheck-gui PRIVATE $<$<NOT :$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
87+ target_compile_definitions (cppcheck-gui PRIVATE $<$<NOT :$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
88+ target_compile_definitions (cppcheck-gui PRIVATE $<$<CONFIG:Debug>:QT_DEBUG>)
8289
8390 if (QHELPGENERATOR)
8491 # TODO: generate in CMAKE_BINARY_DIR folder
0 commit comments