mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux". Issue: #19840
25 lines
702 B
CMake
25 lines
702 B
CMake
include(Platform/Linux)
|
|
|
|
set(ANDROID 1)
|
|
|
|
# Natively compiling on an Android host doesn't need these flags to be reset.
|
|
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
|
|
return()
|
|
endif()
|
|
|
|
# Conventionally Android does not use versioned soname
|
|
# But in modern versions it is acceptable
|
|
if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME)
|
|
set(CMAKE_PLATFORM_NO_VERSIONED_SONAME 1)
|
|
endif()
|
|
|
|
# Android reportedly ignores RPATH, and we cannot predict the install
|
|
# location anyway.
|
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
|
|
|
|
# Nsight Tegra Visual Studio Edition takes care of
|
|
# prefixing library names with '-l'.
|
|
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
|
|
set(CMAKE_LINK_LIBRARY_FLAG "")
|
|
endif()
|