diff options
author | redfish <redfish@galactica.pw> | 2016-07-28 23:34:05 -0400 |
---|---|---|
committer | redfish <redfish@galactica.pw> | 2016-08-01 22:03:53 -0400 |
commit | 33b5ebd055846c7568736aad9cda3bbe8515dd01 (patch) | |
tree | dbeecec50633ac79c93de52b01afafd4662fb886 /CMakeLists.txt | |
parent | cmake: libatomic only needed for 32-bit Clang builds (diff) | |
download | monero-33b5ebd055846c7568736aad9cda3bbe8515dd01.tar.xz |
cmake: do not pass -O2 in debug build on ARM
Also, minor cleanup of redundant flag-setting code.
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 15 |
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) |