diff options
author | redfish <redfish@galactica.pw> | 2016-06-21 20:07:19 -0400 |
---|---|---|
committer | redfish <redfish@galactica.pw> | 2016-06-21 22:32:16 -0400 |
commit | 804b1bc1972a4b5b4f359335d7a74dac65256c42 (patch) | |
tree | 06c8f80461d2371b210b44c4bbb1b7928f7c7f42 /CMakeLists.txt | |
parent | cmake: remove repetitive code in handling of NO_AES (diff) | |
download | monero-804b1bc1972a4b5b4f359335d7a74dac65256c42.tar.xz |
cmake: initialize ARCH for native builds
We need ARCH, because it needs to be set for ARM7, ARM6 to be
initialized.
Strangely, on different machines (both ARMv7, Arch), ${ARCH}
var is either empty or 'native'. Handle both cases.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ab2c83a96..1770b229f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) |