CMake: only set "-O3 -g" defaults if CMAKE_BUILD_TYPE wasn't set at all.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cf7aab..d9aeb49 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}")