Fix release flags

flags were being accumulated instead of being set.
Win32 was getting -O2 -DNDEBUG -Ofast -DNDEBUG etc...
Also for Win32, stay compatible to WinXP
This commit is contained in:
Howard Chu 2016-01-02 19:39:03 +00:00
parent ee6f2cb71f
commit 26aac68095

View file

@ -70,6 +70,9 @@ endif()
if(WIN32 OR ARM7 OR ARM6) if(WIN32 OR ARM7 OR ARM6)
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
else()
set(CMAKE_C_FLAGS_RELEASE "-Ofast -DNDEBUG -Wno-unused-variable")
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -DNDEBUG -Wno-unused-variable")
endif() endif()
# set this to 0 if per-block checkpoint needs to be disabled # set this to 0 if per-block checkpoint needs to be disabled
@ -310,6 +313,9 @@ else()
# mingw doesn't support LTO (multiple definition errors at link time) # mingw doesn't support LTO (multiple definition errors at link time)
set(USE_LTO_DEFAULT false) set(USE_LTO_DEFAULT false)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,10485760") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,10485760")
if(NOT BUILD_64)
add_definitions(-DWINVER=0x0501 -D_WIN32_WINNT=0x0501)
endif()
endif() endif()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes") set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes")
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers") set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers")
@ -353,8 +359,6 @@ else()
set(DEBUG_FLAGS "-g3 -O0") set(DEBUG_FLAGS "-g3 -O0")
endif() endif()
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
if(NOT DEFINED USE_LTO_DEFAULT) if(NOT DEFINED USE_LTO_DEFAULT)
set(USE_LTO_DEFAULT true) set(USE_LTO_DEFAULT true)
endif() endif()