2019-12-05 11:46:01 +01:00
|
|
|
# CMake toolchain to build for Android 5.0 or newer. Sample usage:
|
2019-06-06 14:21:15 +02:00
|
|
|
#
|
2020-03-19 06:53:21 +01:00
|
|
|
set(CMAKE_SYSTEM_NAME Android)
|
|
|
|
set(CMAKE_ANDROID_ARCH_ABI x86)
|
|
|
|
set(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK}")
|
2020-05-21 09:04:05 +02:00
|
|
|
set(CMAKE_ANDROID_STL_TYPE c++_static)
|
2020-03-19 06:53:21 +01:00
|
|
|
set(CMAKE_SYSTEM_VERSION "$ENV{ANDROID_VERSION}")
|
|
|
|
set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang)
|
2019-06-06 14:21:15 +02:00
|
|
|
|
|
|
|
set(ANDROID TRUE)
|
2020-03-19 06:53:21 +01:00
|
|
|
if (WIN32)
|
|
|
|
set(CMAKE_C_COMPILER "$ENV{ANDROID_CC}.exe")
|
|
|
|
set(CMAKE_CXX_COMPILER "$ENV{ANDROID_CC}++.exe")
|
|
|
|
else()
|
|
|
|
set(CMAKE_C_COMPILER "$ENV{ANDROID_CC}")
|
|
|
|
set(CMAKE_CXX_COMPILER "$ENV{ANDROID_CC}++")
|
|
|
|
endif (WIN32)
|
2019-06-06 14:21:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-24 02:55:47 +01:00
|
|
|
add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target i686-linux-android)
|
2019-06-06 14:21:15 +02:00
|
|
|
|