From 2794213fd30c95edd8b83f864c3023727e69d7f9 Mon Sep 17 00:00:00 2001 From: firewave Date: Thu, 31 Oct 2024 16:10:40 +0100 Subject: [PATCH] suppress some Visual Studio warnings for GUI code in Qt5 build --- gui/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 88bf225c58ba..8790e130a9ef 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -63,6 +63,10 @@ CheckOptions: if(MSVC) # compilation will fail as e.g. QList::realloc would be replaced by MSVC's macro definition target_compile_definitions(cppcheck-gui PRIVATE $<$:DISABLE_CRTDBG_MAP_ALLOC>) + if(NOT USE_QT6) + target_add_compile_options(cppcheck-gui PRIVATE /wd4996) # warning C4996: 'QProcess::startDetached': Use QProcess::startDetached(const QString &program, const QStringList &arguments) instead + target_add_compile_options(cppcheck-gui PRIVATE /wd4505) # warning C4505: 'x': unreferenced function with internal linkage has been removed + endif() endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Q_UNUSED() in generated code