From 26aac680951ccb761bf27237e82fff560785d4be Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 2 Jan 2016 19:39:03 +0000 Subject: 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 --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 09cd54774..fed936344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,9 @@ endif() if(WIN32 OR ARM7 OR ARM6) set(CMAKE_C_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() # 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) set(USE_LTO_DEFAULT false) 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() set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes") set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers") @@ -353,8 +359,6 @@ else() set(DEBUG_FLAGS "-g3 -O0") endif() - set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable") - if(NOT DEFINED USE_LTO_DEFAULT) set(USE_LTO_DEFAULT true) endif() -- cgit v1.2.3 From d26e7d0b3a53e0e7a38314b39a108a272d24c2f5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 3 Jan 2016 12:58:08 +0000 Subject: ARMv7 optimization flags are too aggressive --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fed936344..ae2a19c01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,8 +346,8 @@ else() if(ARM7) message(STATUS "Setting ARM7 C and C++ flags") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4 -funsafe-math-optimizations -mtune=cortex-a7") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4 -funsafe-math-optimizations -mtune=cortex-a7") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -mfloat-abi=hard") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -mfloat-abi=hard") endif() if(APPLE) -- cgit v1.2.3