From 21e0ecd9f0698e2e6c3d117b80875e82c44800eb Mon Sep 17 00:00:00 2001 From: Lanchid Date: Fri, 1 Feb 2013 16:19:04 +0100 Subject: [PATCH] Change in CmakeLists.txt: When building debug, add -g as CXX flag (For clang) --- CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8caf0b081..3818fee66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,13 +50,16 @@ option(USE_POPCNT "Sets whether the popcnt instruction is going to be used." ON) option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." ON) # If the DEBUG option was turned on, we will target a debug version and a release version otherwise -if (DEBUG) - set (CMAKE_BUILD_TYPE "DEBUG") - message(STATUS "Building DEBUG version.") -else() - set (CMAKE_BUILD_TYPE "RELEASE") - message(STATUS "Building RELEASE version.") -endif() +#if (DEBUG) +# set (CMAKE_BUILD_TYPE "DEBUG") +# message(STATUS "Building DEBUG version.") +#else() +# set (CMAKE_BUILD_TYPE "RELEASE") +# message(STATUS "Building RELEASE version.") +#endif() + +message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +message(STATUS "CMAKE_BUILD_TYPE (ENV): $ENV{CMAKE_BUILD_TYPE}") if(CMAKE_COMPILER_IS_GNUCC) # Set standard flags for GCC @@ -78,6 +81,8 @@ else(CLANG) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops") set (CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -Werror -pedantic -Wno-unused-variable") + set (CMAKE_CXX_FLAGS_DEBUG "-g") + # Turn on popcnt instruction if desired (yes by default) if (USE_POPCNT) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")