diff options
author | redfish <redfish@galactica.pw> | 2016-08-28 07:28:05 -0400 |
---|---|---|
committer | redfish <redfish@galactica.pw> | 2016-08-28 12:55:33 +0000 |
commit | 1c7d3b05a9bd35c66fd12b6f0ea6e56bb7d46a89 (patch) | |
tree | 96de87dc0e5a8482c37d7bfe902535e589da1d46 /CMakeLists.txt | |
parent | cmake: ARM: exclude libunwind in static build (diff) | |
download | monero-1c7d3b05a9bd35c66fd12b6f0ea6e56bb7d46a89.tar.xz |
cmake: define ARM var for all ARM arch variants
This is refactoring only. No behavior change.
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 80f03a168..26a3211d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,16 +58,20 @@ if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "def else() set(ARCH_ID "${ARCH}") endif() -string(SUBSTRING ${ARCH_ID} 0 5 ARM_TEST) -string(TOLOWER ${ARM_TEST} ARM_TEST) -if (${ARM_TEST} STREQUAL "armv6") - set(ARM6 1) -endif() -if (${ARM_TEST} STREQUAL "armv7") - set(ARM7 1) +string(TOLOWER ${ARCH_ID} ARM_ID) +string(SUBSTRING ${ARCH_ID} 0 3 ARM_TEST) +if (ARM_TEST STREQUAL "arm") + set(ARM 1) + string(SUBSTRING ${ARCH_ID} 0 5 ARM_TEST) + if (ARM_TEST STREQUAL "armv6") + set(ARM6 1) + endif() + if (ARM_TEST STREQUAL "armv7") + set(ARM7 1) + endif() endif() -if(WIN32 OR ARM7 OR ARM6) +if(WIN32 OR ARM) set(OPT_FLAGS_RELEASE "-O2") else() set(OPT_FLAGS_RELEASE "-Ofast") @@ -247,7 +251,7 @@ add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}") find_package(Libunwind) # Can't install hook in static build on OSX, because OSX linker does not support --wrap # On ARM, having libunwind package (with .so's only) installed breaks static link. -if(LIBUNWIND_FOUND AND NOT (STATIC AND (APPLE OR ARM6 OR ARM7))) +if(LIBUNWIND_FOUND AND NOT (STATIC AND (APPLE OR ARM))) set(DEFAULT_STACK_TRACE ON) else() set(DEFAULT_STACK_TRACE OFF) @@ -321,7 +325,7 @@ else() endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang") set(WARNINGS "${WARNINGS} -Wno-deprecated-register -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration") - if(ARM6 OR ARM7) + if(ARM) set(WARNINGS "${WARNINGS} -Wno-error=inline-asm") endif() else() @@ -358,11 +362,11 @@ else() option(NO_AES "Explicitly disable AES support" ${NO_AES}) - if(NOT NO_AES AND NOT (ARM6 OR ARM7)) + if(NOT NO_AES AND NOT ARM) message(STATUS "AES support enabled") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") - elseif(ARM7 OR ARM6) + elseif(ARM) message(STATUS "AES support disabled (not available on ARM)") else() message(STATUS "AES support disabled") |