Skip to content

Commit

Permalink
CMake: Make sure _GLIBCXX_ASSERTIONS is disabled in release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dscharrer committed Jul 18, 2021
1 parent a35a196 commit d8cc75c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/BuildType.cmake
Expand Up @@ -408,11 +408,15 @@ else(MSVC)
string(REGEX REPLACE "(^| )-DNDEBUG( |$)" "\\1" ${flag_var} "${${flag_var}}")
set(${flag_var} "${${flag_var}} -D_GLIBCXX_ASSERTIONS=1")
else()
set(${flag_var} "${${flag_var}} -DNDEBUG -U_GLIBCXX_ASSERTIONS")
set(${flag_var} "${${flag_var}} -DNDEBUG")
endif()

endforeach(flag_var)

if(NOT DEBUG AND NOT IS_LIBCXX)
add_cxxflag("-Wp,-U_GLIBCXX_ASSERTIONS")
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")

# set debug symbol level to -g3
Expand Down

0 comments on commit d8cc75c

Please sign in to comment.