From 083388650662bbc26beafa157124973c7e905396 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 26 Mar 2025 15:35:20 +0300 Subject: CMake: Enable stricter debug of STL containers --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0212c5..06896b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,6 +130,10 @@ if(CMAKE_BUILD_TYPE_LOWER EQUAL "release") add_definitions(-DNDEBUG) ENDIF() +if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug" AND CMAKE_COMPILER_IS_GNUCXX) + add_definitions(-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_ASSERTIONS=1) +endif() + # Disable bogus MSVC warnings if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) -- cgit v1.2.3