Skip to content

Commit

Permalink
Android: Fix toolchain setup
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Mar 15, 2021
1 parent 47dcd34 commit 44c11d6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions android-toolchain-ndk-r19c.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,20 @@ else()
set(ANDROID_COMPILE_SDK android-28)
endif()

if(ANDROID_SDK_ROOT AND ANDROID_NDK_ROOT)
set(sdk_host "") # external SDK and NDK
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
message(FATAL_ERROR "System processor must be x86_64")
elseif(APPLE)
set(sdk_host "darwin")
elseif(UNIX AND NOT APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
elseif(UNIX)
set(sdk_host "linux")
elseif(WIN32)
set(sdk_host "windows") # Untested
else()
message(FATAL_ERROR "Unsupported sdk_host")
endif()

if(sdk_host AND NOT sdk_host STREQUAL "windows")
# Not relying on ANDROID_SDK_ROOT / ANDROID_NDK_ROOT
elseif(NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "ANDROID_SDK_ROOT must be set to an external SDK")
elseif(NOT ANDROID_NDK_ROOT)
Expand Down

0 comments on commit 44c11d6

Please sign in to comment.