aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2022-02-24 14:53:36 +0100
committerCristian Adam <cristian.adam@qt.io>2022-02-25 09:54:49 +0000
commit47667772c7a4f1205cbe55412885de7c64410fea (patch)
treed5d395d6c8ac7be211566fd35ade7b6e6d5aa77f /CMakeLists.txt
parent79726e52d66eca450032cc4fbf0aeae81c1c7979 (diff)
CMake: Enable higher compiler warnings for building Qt Creator
The functionality comes from Qt6 and will be enabled only for Qt6 builds. /w3 level for MSVC, -Wall -Wextra for the rest of compilers. Change-Id: Ib62a27e50ce37a6a860ba2bfa1bdb80a7ae60ace Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 187fccd493..4da4284a49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,10 +68,14 @@ if (Qt5_VERSION VERSION_LESS 6.0.0)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
add_compile_options(-Wno-missing-field-initializers)
-endif()
+ endif()
else()
# Common intermediate directory for QML modules which are defined via qt_add_qml_module()
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml_modules")
+
+ # This includes the code that will enable higher compiler warnings level (/W3 for MSVC, -Wall -Wextra for GCC)
+ # This is controlled by QT_COMPILE_OPTIONS_DISABLE_WARNINGS target property.
+ include(QtCompilerFlags)
endif()
find_package(Qt5 COMPONENTS LinguistTools QUIET)
find_package(Qt5 COMPONENTS Quick QuickWidgets Designer DesignerComponents Help SerialPort Svg Tools QUIET)