Skip to content

Commit b3ccc01

Browse files
author
Leo
authored
Merge pull request #12670 from ethereum/msvc-asserts
MSVC asserts
2 parents 4ee9846 + c22f0ef commit b3ccc01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/EthCompilerSettings.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
151151

152152
# The major alternative compiler to GCC/Clang is Microsoft's Visual C++ compiler, only available on Windows.
153153
elseif (DEFINED MSVC)
154+
# Remove NDEBUG from RELWITHDEBINFO (to enable asserts)
155+
# CMAKE_CXX_FLAGS_RELWITHDEBINFO for GCC/Clang does not include NDEBUG
156+
string(REPLACE "/DNDEBUG" " " CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
154157

155-
add_compile_options(/MP) # enable parallel compilation
158+
add_compile_options(/MP) # enable parallel compilation
156159
add_compile_options(/EHsc) # specify Exception Handling Model in msvc
157160
add_compile_options(/WX) # enable warnings-as-errors
158161
add_compile_options(/wd4068) # disable unknown pragma warning (4068)

0 commit comments

Comments
 (0)