Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ CheckOptions:
- { key: HeaderFileExtensions, value: 'x' }
")

# TODO: limit to target
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
add_compile_definitions($<$<CONFIG:Debug>:QT_DEBUG>)

file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")
file(GLOB uis "*.ui")
Expand Down Expand Up @@ -73,12 +67,25 @@ CheckOptions:
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(cppcheck-gui -Wno-extra-semi-stmt)
# caused by Qt generated moc code
target_compile_options_safe(cppcheck-gui -Wno-redundant-parens)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(cppcheck-gui -Wno-extra-semi-stmt)
endif()
if(QT_VERSION VERSION_LESS "6.4.0")
# caused by Qt generated moc code - see https://bugreports.qt.io/browse/QTBUG-100915
target_compile_options_safe(cppcheck-gui -Wno-redundant-parens)
endif()
endif()
#target_compile_definitions(cppcheck-gui PRIVATE -DQT_NO_QPAIR) # TODO: cannot be completely disabled because QBrush uses QPair
if(QT_VERSION VERSION_GREATER_EQUAL "6.9.0")
# QBrush fails to compile before 6.9.0 - see https://bugreports.qt.io/browse/QTBUG-134038
target_compile_definitions(cppcheck-gui PRIVATE -DQT_NO_QPAIR)
endif()
target_compile_definitions(cppcheck-gui PRIVATE -DQT_NO_FOREACH)

target_compile_definitions(cppcheck-gui PRIVATE $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
target_compile_definitions(cppcheck-gui PRIVATE $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
target_compile_definitions(cppcheck-gui PRIVATE $<$<NOT:$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
target_compile_definitions(cppcheck-gui PRIVATE $<$<CONFIG:Debug>:QT_DEBUG>)

if (QHELPGENERATOR)
# TODO: generate in CMAKE_BINARY_DIR folder
Expand Down
2 changes: 1 addition & 1 deletion gui/compliancereportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void ComplianceReportDialog::buttonClicked(QAbstractButton* button)
break;
default:
break;
};
}
}

void ComplianceReportDialog::save()
Expand Down
2 changes: 1 addition & 1 deletion gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ bool MainWindow::getCppcheckSettings(Settings& settings, Suppressions& supprs)
case ProjectFile::CheckLevel::exhaustive:
settings.setCheckLevel(Settings::CheckLevel::exhaustive);
break;
};
}
settings.checkHeaders = mProjectFile->getCheckHeaders();
settings.checkUnusedTemplates = mProjectFile->getCheckUnusedTemplates();
settings.safeChecks.classes = mProjectFile->safeChecks.classes;
Expand Down
2 changes: 1 addition & 1 deletion gui/projectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ bool ProjectFile::write(const QString &filename)
xmlWriter.writeStartElement(CppcheckXml::CheckLevelExhaustiveElementName);
xmlWriter.writeEndElement();
break;
};
}

// Cppcheck Premium
if (mBughunting) {
Expand Down
2 changes: 1 addition & 1 deletion gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
case ProjectFile::CheckLevel::exhaustive:
mUI->mCheckLevelExhaustive->setChecked(true);
break;
};
}
mUI->mCheckHeaders->setChecked(projectFile->getCheckHeaders());
mUI->mCheckUnusedTemplates->setChecked(projectFile->getCheckUnusedTemplates());
mUI->mInlineSuppressions->setChecked(projectFile->getInlineSuppression());
Expand Down
6 changes: 4 additions & 2 deletions gui/test/cppchecklibrarydata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ target_compile_definitions(test-cppchecklibrarydata PRIVATE SRCDIR="${CMAKE_CURR
target_link_libraries(test-cppchecklibrarydata ${QT_CORE_LIB} ${QT_TEST_LIB})

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(test-cppchecklibrarydata -Wno-extra-semi-stmt)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(test-cppchecklibrarydata -Wno-extra-semi-stmt)
endif()
endif()

if (REGISTER_GUI_TESTS)
Expand Down
6 changes: 4 additions & 2 deletions gui/test/filelist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ target_compile_definitions(test-filelist PRIVATE SRCDIR="${CMAKE_CURRENT_SOURCE_
target_link_libraries(test-filelist ${QT_CORE_LIB} ${QT_TEST_LIB})

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(test-filelist -Wno-extra-semi-stmt)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(test-filelist -Wno-extra-semi-stmt)
endif()
endif()

if (REGISTER_GUI_TESTS)
Expand Down
6 changes: 4 additions & 2 deletions gui/test/projectfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ target_compile_definitions(test-projectfile PRIVATE SRCDIR="${CMAKE_CURRENT_SOUR
target_link_libraries(test-projectfile ${QT_CORE_LIB} ${QT_TEST_LIB})

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(test-projectfile -Wno-extra-semi-stmt)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(test-projectfile -Wno-extra-semi-stmt)
endif()
endif()

if (REGISTER_GUI_TESTS)
Expand Down
6 changes: 4 additions & 2 deletions gui/test/resultstree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
endif()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(test-resultstree -Wno-extra-semi-stmt)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(test-resultstree -Wno-extra-semi-stmt)
endif()
# caused by mocks
target_compile_options_safe(test-resultstree -Wno-missing-noreturn)
endif()
Expand Down
6 changes: 4 additions & 2 deletions gui/test/translationhandler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ target_include_directories(test-translationhandler PRIVATE ${CMAKE_SOURCE_DIR}/g
target_link_libraries(test-translationhandler ${QT_CORE_LIB} ${QT_WIDGETS_LIB} ${QT_TEST_LIB})

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(test-translationhandler -Wno-extra-semi-stmt)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(test-translationhandler -Wno-extra-semi-stmt)
endif()
endif()

if (REGISTER_GUI_TESTS)
Expand Down
5 changes: 4 additions & 1 deletion gui/test/xmlreportv2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ if (BUILD_CORE_DLL)
target_link_libraries(test-xmlreportv2 cppcheck-core)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options_safe(test-xmlreportv2 -Wno-extra-semi-stmt)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(test-xmlreportv2 -Wno-extra-semi-stmt)
endif()
endif()

if (REGISTER_GUI_TESTS)
Expand Down
31 changes: 19 additions & 12 deletions tools/triage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ CheckOptions:
- { key: HeaderFileExtensions, value: 'x' }
")

# TODO: limit to target
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
add_compile_definitions($<$<CONFIG:Debug>:QT_DEBUG>)

file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")
file(GLOB uis "*.ui")
Expand All @@ -28,14 +22,27 @@ CheckOptions:
${PROJECT_SOURCE_DIR}/gui/codeeditorstyle.cpp
${PROJECT_SOURCE_DIR}/gui/codeeditor.cpp)
set_target_properties(triage PROPERTIES AUTOMOC ON)
set_target_properties(cppcheck-gui PROPERTIES WIN32_EXECUTABLE ON)
set_target_properties(triage PROPERTIES WIN32_EXECUTABLE ON)
target_include_directories(triage PRIVATE ${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/gui/)
target_link_libraries(triage ${QT_CORE_LIB} ${QT_GUI_LIB} ${QT_WIDGETS_LIB})
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Q_UNUSED() in generated code
target_compile_options_safe(triage -Wno-extra-semi-stmt)
# caused by Qt generated moc code
target_compile_options_safe(triage -Wno-redundant-parens)
if(QT_VERSION VERSION_LESS "6.0.0")
# Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
target_compile_options_safe(triage -Wno-extra-semi-stmt)
endif()
if(QT_VERSION VERSION_LESS "6.4.0")
# caused by Qt generated moc code - see https://bugreports.qt.io/browse/QTBUG-100915
target_compile_options_safe(triage -Wno-redundant-parens)
endif()
endif()
if(QT_VERSION VERSION_GREATER_EQUAL "6.9.0")
# QBrush fails to compile before 6.9.0 - see https://bugreports.qt.io/browse/QTBUG-134038
target_compile_definitions(triage PRIVATE -DQT_NO_QPAIR)
endif()
#target_compile_definitions(triage PRIVATE -DQT_NO_QPAIR) # TODO: cannot be completely disabled because QBrush uses QPair
target_compile_definitions(triage PRIVATE -DQT_NO_FOREACH)

target_compile_definitions(triage PRIVATE $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
target_compile_definitions(triage PRIVATE $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
target_compile_definitions(triage PRIVATE $<$<NOT:$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
target_compile_definitions(triage PRIVATE $<$<CONFIG:Debug>:QT_DEBUG>)
endif()