CMake: only set "-O3 -g" defaults if CMAKE_BUILD_TYPE wasn't set at all.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 08 Jan 2016 07:32:51 -0500
changeset 10047281d1bfdacb1
parent 10046 4b62fb588d22
child 10048 b86bef2d4f30
CMake: only set "-O3 -g" defaults if CMAKE_BUILD_TYPE wasn't set at all.
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Fri Jan 08 07:21:15 2016 -0500
     1.2 +++ b/CMakeLists.txt	Fri Jan 08 07:32:51 2016 -0500
     1.3 @@ -158,8 +158,10 @@
     1.4  
     1.5  # Default flags, if not set otherwise
     1.6  if("$ENV{CFLAGS}" STREQUAL "")
     1.7 -  if(USE_GCC OR USE_CLANG)
     1.8 -    set(CMAKE_C_FLAGS "-g -O3")
     1.9 +  if(CMAKE_BUILD_TYPE STREQUAL "")
    1.10 +    if(USE_GCC OR USE_CLANG)
    1.11 +      set(CMAKE_C_FLAGS "-g -O3")
    1.12 +    endif()
    1.13    endif()
    1.14  else()
    1.15    set(CMAKE_C_FLAGS "$ENV{CFLAGS}")