From: RĂ©mi Verschelde Date: Wed, 7 Dec 2016 21:44:56 +0000 (+0100) Subject: Fix CXX flags in various CMake build types X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=commitdiff_plain;h=20e924d9798018d8b9be675685678bbae90bb8cd Fix CXX flags in various CMake build types The flags we were defining for _DEBUG and _RELEASE were similar to the default CMake flags for those types, which get appended to CMAKE_CXX_FLAGS, so we only need to customize the latter. The final flags will be for e.g. RelWithDebInfo: ${CMAKE_CXX_FLAGS} ${CXXFLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} with ${CXXFLAGS} taken from the environment. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 84a24ed..6b5f226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,7 @@ endif() ### CMake config -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --std=c++11") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-parentheses -pedantic -g -pg --std=c++11") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-parentheses -O2 -std=c++11") +set(CMAKE_CXX_FLAGS "-Wall -Wno-parentheses --std=c++11 ${CMAKE_CXX_FLAGS}") if(APPLE) set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")