diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 387d6ee..5405d04 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,8 +38,17 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") # Build debug build as default if(NOT CMAKE_BUILD_TYPE) -# set(CMAKE_BUILD_TYPE RelWithDebInfo) - set(CMAKE_BUILD_TYPE Release) + # set(CMAKE_BUILD_TYPE Release) + if(CMAKE_COMPILER_IS_GNUCXX) + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) + if (GCC_VERSION VERSION_GREATER 4.6) + set(CMAKE_BUILD_TYPE RelWithDebInfo) + else() + set(CMAKE_BUILD_TYPE Debug) + endif() + else() + set(CMAKE_BUILD_TYPE RelWithDebInfo) + endif() endif() if(CMAKE_COMPILER_IS_GNUCXX) |