Skip to content

Commit

Permalink
Fail fast with verbose error when trying to native compile on non-ARM
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Vobruba <hoijui.quaero@gmail.com>
  • Loading branch information
hoijui committed Oct 18, 2018
1 parent 7c84151 commit faa5fd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ if(ANDROID_PLATFORM AND ANDROID_DEMO)
add_subdirectory(android/NE10Demo/jni)
endif()

# Make sure we are compiling for an ARM system.
# This is a verbose fail-fast in case we are trying to compile for non-ARM;
# otherwise it would fail at `make` with obscure errors.
if(GNULINUX_PLATFORM AND (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^arm"))
message(FATAL_ERROR "You are trying to compile for non-ARM (CMAKE_SYSTEM_PROCESSOR='${CMAKE_SYSTEM_PROCESSOR}')! see doc/building.md for cross compilation instructions.")
endif()

if(IOS_PLATFORM AND IOS_DEMO)
add_subdirectory(ios)
endif()
2 changes: 2 additions & 0 deletions GNUlinux_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
# armv7 or aarch64 (Not done yet). Defaut is armv7.

set(GNULINUX_PLATFORM ON)
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "arm")

if(NOT DEFINED ENV{NE10_LINUX_TARGET_ARCH})
set(NE10_LINUX_TARGET_ARCH "armv7")
Expand Down

0 comments on commit faa5fd7

Please sign in to comment.