From b428059c8b0b92ef93628eb181e73e65f5058a0d Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Sat, 18 Nov 2023 17:56:27 +0000 Subject: [PATCH] Enable compiler warnings --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52c89d06a..81e5f97ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Multimedia Network OpenGL Con # Global compiler options if(MSVC) - add_compile_options(/wd4351 /wd4661) + add_compile_options(/W3 /w34100 /w34189 /wd4661) # https://doc.qt.io/qt-6/qt-disable-unicode-defines.html add_compile_definitions(UNICODE) @@ -102,6 +102,12 @@ if(MSVC) # Debug iterators used by Qt 5 add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING) +elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) + add_compile_options(-Wall -Wextra) + add_compile_options("$<$:-Woverloaded-virtual;-Wzero-as-null-pointer-constant;-Wsuggest-override>") +elseif(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang") + add_compile_options(-Wall -Wextra) + add_compile_options("$<$:-Woverloaded-virtual;-Wzero-as-null-pointer-constant;-Wno-return-std-move>") endif() add_compile_definitions(QT_NO_DEPRECATED_WARNINGS)