summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Android-Initialize.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index f12b796..f05357c 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -20,3 +20,22 @@
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
return()
endif()
+
+if(NOT CMAKE_SYSROOT)
+ if(CMAKE_ANDROID_NDK)
+ set(CMAKE_SYSROOT "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}")
+ endif()
+endif()
+
+if(CMAKE_SYSROOT)
+ if(NOT IS_DIRECTORY "${CMAKE_SYSROOT}")
+ message(FATAL_ERROR
+ "Android: The system root directory needed for the selected Android version and architecture does not exist:\n"
+ " ${CMAKE_SYSROOT}\n"
+ )
+ endif()
+else()
+ message(FATAL_ERROR
+ "Android: No CMAKE_SYSROOT was selected."
+ )
+endif()