cmake: ARCH_ID fixes for cross compilation

This commit is contained in:
TheCharlatan 2019-02-22 15:18:32 +00:00 committed by moneromooo-monero
parent 5fb4a9719c
commit 5057eb1199
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 10 additions and 0 deletions

View file

@ -115,6 +115,9 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
# to identify the target architecture, to direct logic in this cmake script.
# Since ARCH is a cached variable, it will not be set on first cmake invocation.
if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "default")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}")
else()
set(ARCH_ID "${ARCH}")