From c4749035499df2083ca3b19ab3e9142d54a5ccba Mon Sep 17 00:00:00 2001 From: Fabian Wolff Date: Sun, 13 Mar 2016 15:08:25 +0100 Subject: [PATCH] Improve CMAKE_BUILD_TYPE handling --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index add3193..12bb6c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,12 @@ if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_BUILD_TYPE STREQUAL "Release") set(SQ_FLAGS ${SQ_FLAGS} -O3) - else() - set(SQ_FLAGS ${SQ_FLAGS} -pg -pie -gstabs -g3) + elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + set(SQ_FLAGS ${SQ_FLAGS} -O3 -g) + elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") + set(SQ_FLAGS ${SQ_FLAGS} -Os) + elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(SQ_FLAGS ${SQ_FLAGS} -pg -pie -gstabs -g3 -Og) endif() if(CMAKE_VERSION VERSION_GREATER 3)