aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt15
1 files changed, 8 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93423462e..90d06c12d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,13 +73,14 @@ if (NOT "${ARCH}" STREQUAL "")
endif()
if(WIN32 OR ARM7 OR ARM6)
- set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
- set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
+ set(OPT_FLAGS_RELEASE "-O2")
else()
- set(CMAKE_C_FLAGS_RELEASE "-Ofast -DNDEBUG -Wno-unused-variable")
- set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -DNDEBUG -Wno-unused-variable")
+ set(OPT_FLAGS_RELEASE "-Ofast")
endif()
+set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG ${OPT_FLAGS_RELEASE}")
+set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${OPT_FLAGS_RELEASE}")
+
# set this to 0 if per-block checkpoint needs to be disabled
set(PER_BLOCK_CHECKPOINT 1)
@@ -322,7 +323,7 @@ else()
set(ARCH_FLAG "-march=${ARCH}")
endif()
endif()
- set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized")
+ set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized")
if(NOT MINGW)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
@@ -383,8 +384,8 @@ else()
if(ARM7)
message(STATUS "Setting ARM7 C and C++ flags")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -mfloat-abi=hard")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -mfloat-abi=hard")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=hard")
endif()
if(APPLE)