Enable asserts in MSVC RelWithDebInfo configuration

This commit is contained in:
a3d4
2022-02-14 20:28:21 +01:00
committed by Leo Alt
parent e3e77c0f01
commit 10a431a18b
+3 -1
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)