From 1615b2e29d33df8f8107bfe2260190fc69d6d440 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 8 Jan 2016 07:32:51 -0500 Subject: [PATCH] CMake: only set "-O3 -g" defaults if CMAKE_BUILD_TYPE wasn't set at all. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cf7aab3c2b30..d9aeb490eb40e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,8 +158,10 @@ endif() # Default flags, if not set otherwise if("$ENV{CFLAGS}" STREQUAL "") - if(USE_GCC OR USE_CLANG) - set(CMAKE_C_FLAGS "-g -O3") + if(CMAKE_BUILD_TYPE STREQUAL "") + if(USE_GCC OR USE_CLANG) + set(CMAKE_C_FLAGS "-g -O3") + endif() endif() else() set(CMAKE_C_FLAGS "$ENV{CFLAGS}")