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.
pull/95/head
redfish 8 years ago
parent bb39034405
commit 804b1bc197

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

Loading…
Cancel
Save