cmake: define ARM var for all ARM arch variants

This is refactoring only. No behavior change.
This commit is contained in:
redfish 2016-08-28 07:28:05 -04:00
parent 6fe543dcd4
commit 1c7d3b05a9
1 changed files with 16 additions and 12 deletions

View File

@ -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")