summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Shanks <bshanks@audiovox.com>2014-04-02 13:07:06 -0700
committerJustin Dickow <jjdickow@gmail.com>2014-04-02 16:20:26 -0400
commit0c4c4c651ee0aab0c42d5f11fb7e1d51c6ef4580 (patch)
tree80fa0bf2a39db7224a80fcf301579edc1bfce540
parent1f32866155afd06cd9ab8e6982f7ba0544ef1448 (diff)
downloadsmartdevicelink-0c4c4c651ee0aab0c42d5f11fb7e1d51c6ef4580.tar.gz
CMakeLists: Add _GLIBCXX_DEBUG to enable debug mode for GNU libstdc++
When building in debug mode, define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC to enable debug mode in GNU libstdc++. This will throw runtime exceptions to catch incorrect/undefined C++/STL behavior.
-rw-r--r--SDL_Core/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/SDL_Core/CMakeLists.txt b/SDL_Core/CMakeLists.txt
index 3466830fd..befbf48df 100644
--- a/SDL_Core/CMakeLists.txt
+++ b/SDL_Core/CMakeLists.txt
@@ -101,6 +101,10 @@ add_definitions(-DOS_POSIX)
IF(CMAKE_C_FLAGS_DEBUG)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG" )
add_definitions(-DDEBUG)
+
+ # Enable debug mode in the GNU C++ library, to catch incorrect/undefined behavior
+ add_definitions(-D_GLIBCXX_DEBUG)
+ add_definitions(-D_GLIBCXX_DEBUG_PEDANTIC)
ELSE (CMAKE_C_FLAGS_DEBUG)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRELEASE" )
add_definitions(-DRELEASE)