From 5785146dd375b1ce7494dfee8047a05af8917822 Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Tue, 12 May 2020 09:06:37 +0300 Subject: [PATCH] Set the highest level of compilation warnings. --- CMakeCommon/Common.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeCommon/Common.cmake b/CMakeCommon/Common.cmake index 1292e21b1..4ad9e74b0 100644 --- a/CMakeCommon/Common.cmake +++ b/CMakeCommon/Common.cmake @@ -57,3 +57,14 @@ IF(UNIX) #MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS}) ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(UNIX) + +# Set highest warnings level +IF(MSVC) + IF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() +ELSE() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +ENDIF() -- 2.39.2