diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index 0d6cd339ee..b156d5fe62 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -430,6 +430,17 @@ if(NOT ${_PERL_EXECUTABLE} MATCHES "-NOTFOUND") endif() endif() +option(debug_glibc "Enable libstdc++ debug mode" OFF) +option(debug_glibc_pedantic "Enable libstdc++pedantic debug mode" OFF) + +if(debug_glibc) + set(_GLIBCXX_DEBUG 1) +endif() + +if(debug_glibc_pedantic) + set(_GLIBCXX_DEBUG_PEDANTIC 1) +endif() + # compiler tests, config.h generation if(MSVC AND NOT CONFIGURECHECKS) configure_file(configCompiler.h.msvc ${CMAKE_BINARY_DIR}/configCompiler.h) diff --git a/development/cmake/configCompiler.h.cmake b/development/cmake/configCompiler.h.cmake index 487eef9729..67b7744929 100644 --- a/development/cmake/configCompiler.h.cmake +++ b/development/cmake/configCompiler.h.cmake @@ -173,6 +173,7 @@ #define HAVE_MODE_T #endif - +#cmakedefine _GLIBCXX_DEBUG 1 +#cmakedefine _GLIBCXX_DEBUG_PEDANTIC 1 #endif