1# Include the NDK hook. 2# It can be used by NDK to inject necessary fixes for an earlier cmake. 3if(CMAKE_ANDROID_NDK) 4 include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android.cmake OPTIONAL) 5endif() 6 7include(Platform/Linux) 8 9set(ANDROID 1) 10 11# Natively compiling on an Android host doesn't need these flags to be reset. 12if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") 13 return() 14endif() 15 16# Conventionally Android does not use versioned soname 17# But in modern versions it is acceptable 18if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME) 19 set(CMAKE_PLATFORM_NO_VERSIONED_SONAME 1) 20endif() 21 22# Android reportedly ignores RPATH, and we cannot predict the install 23# location anyway. 24set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") 25 26# Nsight Tegra Visual Studio Edition takes care of 27# prefixing library names with '-l'. 28if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") 29 set(CMAKE_LINK_LIBRARY_FLAG "") 30endif() 31 32# Commonly used Android toolchain files that pre-date CMake upstream support 33# set CMAKE_SYSTEM_VERSION to 1. Avoid interfering with them. 34if(CMAKE_SYSTEM_VERSION EQUAL 1) 35 return() 36endif() 37 38# Include the NDK hook. 39# It can be used by NDK to inject necessary fixes for an earlier cmake. 40if(CMAKE_ANDROID_NDK) 41 include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Android.cmake OPTIONAL) 42endif() 43