diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 6cad20cac6..399b3acd20 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -228,6 +228,11 @@ function(interrogate_sources target output database language_flags) endif() endforeach(build_type) + # In case the user (or a distro buildsystem) is throwing NDEBUG in by hand: + if(CMAKE_CXX_FLAGS MATCHES ".*NDEBUG.*") + list(APPEND define_flags "-DNDEBUG") + endif() + get_filename_component(output_directory "${output}" DIRECTORY) get_filename_component(database_directory "${database}" DIRECTORY)