summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-05-13 10:12:58 +0200
committerEike Ziller <eike.ziller@qt.io>2022-05-13 08:59:33 +0000
commit55951a6ca0939f6dd93a62fcf898d71bca824dc4 (patch)
tree4f95aba0f4d665a45fa59865715ebe85c0668e4a /CMakeLists.txt
parentf29c53b4f65ce9fa98cfd546b92512bc214edc4e (diff)
downloadqt-creator-55951a6ca0939f6dd93a62fcf898d71bca824dc4.tar.gz
MSVC: Disable bogus warning
MSVC incorrectly warns when using a static method in a lambda that has non-static overloads, and not capturing 'this' in the lambda. That wouldn't be a big issue if other compilers wouldn't then warn about 'this' being captured and not used. Simply disable the warning. Change-Id: I40b96c4758f7468c1e6f3577119123e0c7abf241 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4195eb781..aba83469be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,14 @@ if (WITH_TESTS)
set(IMPLICIT_DEPENDS Qt5::Test)
endif()
+# suppress bogus warning
+# warning C4573 requires the compiler to capture 'this' but the current default capture mode does not allow it
+# when using QObject::connect in lambda without capturing 'this' - which would lead to warnings
+# with other compilers
+if(MSVC)
+ add_compile_options(/wd4573)
+endif()
+
find_package(Qt5
${IDE_QT_VERSION_MIN}
COMPONENTS Concurrent Core Gui Network PrintSupport Qml Sql Widgets Xml Core5Compat ${QT_TEST_COMPONENT}