CMake: Remove disabling asserts for release builds

This commit is contained in:
Jonathan G Rennison
2020-06-27 19:27:21 +01:00
parent 73edc5aaba
commit 4cee6f3d79

View File

@@ -36,7 +36,7 @@ macro(compile_flags)
# Prepare a generator that checks if we are not a debug, and don't have asserts # Prepare a generator that checks if we are not a debug, and don't have asserts
# on. We need this later on to set some compile options for stable releases. # on. We need this later on to set some compile options for stable releases.
set(IS_STABLE_RELEASE "$<AND:$<NOT:$<CONFIG:Debug>>,$<NOT:$<BOOL:${OPTION_USE_ASSERTS}>>>") #set(IS_STABLE_RELEASE "$<AND:$<NOT:$<CONFIG:Debug>>,$<NOT:$<BOOL:${OPTION_USE_ASSERTS}>>>")
if (MSVC) if (MSVC)
add_compile_options(/W3) add_compile_options(/W3)
@@ -68,14 +68,14 @@ macro(compile_flags)
-fno-strict-aliasing -fno-strict-aliasing
) )
add_compile_options( #add_compile_options(
# When we are a stable release (Release build + USE_ASSERTS not set), # When we are a stable release (Release build + USE_ASSERTS not set),
# assertations are off, which trigger a lot of warnings. We disable # assertations are off, which trigger a lot of warnings. We disable
# these warnings for these releases. # these warnings for these releases.
"$<${IS_STABLE_RELEASE}:-Wno-unused-variable>" #"$<${IS_STABLE_RELEASE}:-Wno-unused-variable>"
"$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-parameter>" #"$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-parameter>"
"$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>" #"$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>"
) #)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)