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.
This commit is contained in:
redfish 2016-06-21 20:07:19 -04:00
parent bb39034405
commit 804b1bc197

View File

@ -45,7 +45,12 @@ function (die msg)
message(FATAL_ERROR "${BoldRed}${msg}${ColourReset}") message(FATAL_ERROR "${BoldRed}${msg}${ColourReset}")
endfunction () 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(SUBSTRING ${ARCH} 0 3 IS_ARM)
string(TOLOWER ${IS_ARM} IS_ARM) string(TOLOWER ${IS_ARM} IS_ARM)