From 62759e8de1ae37ad84d06905cff6cfa14634db5b Mon Sep 17 00:00:00 2001 From: Mateusz Loskot Date: Sat, 18 Jan 2014 14:03:30 +0000 Subject: [PATCH] Fix for CMake build type default flags being lost The CMakeLists.txt adds -std=c++11 and related compiler flags, but looses default flags specified by CMake build type. For example, -DCMAKE_BUILD_TYPE=Debug has no effect, as -g flag gets lost. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f8109f4..5af682b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,9 @@ enable_testing() message(STATUS "Using ${CMAKE_CXX_COMPILER} (compiler id: ${CMAKE_CXX_COMPILER_ID})") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++") + set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "-std=c++11") + set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") endif () set(include_dir "${PROJECT_SOURCE_DIR}/include")