From 85bc910e6af75fff259699ceb7ac09a8ac476a74 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 14 Dec 2017 03:27:49 +0100 Subject: [PATCH] cmake: MSVC should always show all warnings --- CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac44b589..9f929901 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,19 +131,19 @@ else() "${PATH_OBSStudio}" ) add_definitions(-D_CRT_SECURE_NO_WARNINGS) - - # All Warnings, Extra Warnings, Pedantic - if(MSVC) - # Force to always compile with W4 - if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") +endif() + +# All Warnings, Extra Warnings, Pedantic +if(MSVC) + # Force to always compile with W4 + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - else() + else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - endif() - elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - # Update if necessary - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic") endif() +elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + # Update if necessary + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic") endif() ################################################################################