Merge pull request #877

ecd0f2d makefile: remove unnecessary ARM-specific targets (redfish)
c650160 cmake: disable AES on ARM (redfish)
804b1bc cmake: initialize ARCH for native builds (redfish)
bb39034 cmake: remove repetitive code in handling of NO_AES (redfish)
This commit is contained in:
Riccardo Spagni 2016-07-06 18:14:03 +02:00
commit 65df33fb06
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
2 changed files with 16 additions and 16 deletions

View file

@ -45,7 +45,12 @@ function (die msg)
message(FATAL_ERROR "${BoldRed}${msg}${ColourReset}")
endfunction ()
if (NOT ${ARCH} STREQUAL "")
if ("${ARCH}" STREQUAL "" OR "${ARCH}" STREQUAL "native")
set(ARCH ${CMAKE_SYSTEM_PROCESSOR})
message(STATUS "Building natively on ${ARCH}")
endif()
if (NOT "${ARCH}" STREQUAL "")
string(SUBSTRING ${ARCH} 0 3 IS_ARM)
string(TOLOWER ${IS_ARM} IS_ARM)
@ -342,16 +347,19 @@ else()
set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert")
endif()
option(NO_AES "Explicitly disable AES support" ${NO_AES})
if (NO_AES)
message(STATUS "Disabling AES support")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}")
option(NO_AES "Explicitly disable AES support" ${NO_AES})
if(NOT NO_AES AND NOT (ARM6 OR ARM7))
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)
message(STATUS "AES support disabled (not available on ARM)")
else()
message(STATUS "Enabling AES support")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} -maes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} -maes")
message(STATUS "AES support disabled")
endif()
if(ARM6)

View file

@ -58,14 +58,6 @@ release-all:
mkdir -p build/release
cd build/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)
release-arm6:
mkdir -p build/release
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv6zk" -D BUILD_64=OFF -D NO_AES=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)
release-arm7:
mkdir -p build/release
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D BUILD_64=OFF -D NO_AES=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)
release-static: release-static-64
release-static-64: