cmake: MSVC should always show all warnings

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2017-12-14 03:27:49 +01:00
parent afdf18b33b
commit 85bc910e6a

View file

@ -131,19 +131,19 @@ else()
"${PATH_OBSStudio}" "${PATH_OBSStudio}"
) )
add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
# All Warnings, Extra Warnings, Pedantic
if(MSVC) # All Warnings, Extra Warnings, Pedantic
# Force to always compile with W4 if(MSVC)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") # 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}") string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") 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() 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() endif()
################################################################################ ################################################################################