Enable asserts in MSVC RelWithDebInfo configuration

This commit is contained in:
a3d4 2022-02-08 03:52:30 +01:00 committed by Leo Alt
parent e3e77c0f01
commit 10a431a18b

View File

@ -151,8 +151,10 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# The major alternative compiler to GCC/Clang is Microsoft's Visual C++ compiler, only available on Windows.
elseif (DEFINED MSVC)
# Remove NDEBUG from RELWITHDEBINFO (to enable asserts)
string(REPLACE "/DNDEBUG" " " CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
add_compile_options(/MP) # enable parallel compilation
add_compile_options(/MP) # enable parallel compilation
add_compile_options(/EHsc) # specify Exception Handling Model in msvc
add_compile_options(/WX) # enable warnings-as-errors
add_compile_options(/wd4068) # disable unknown pragma warning (4068)