Android: Removed custom toolchain file
This commit drops the previous custom CMake toolchain file for Android in favor of CMake's new built-in toolchain for this (CMake >3.7.2). This makes building SFML for Android a lot simpler and more straight forward, working almost as smooth as other platforms. To configure your build directory, all you have to do is defining just a few variables the first time you invoke CMake. **Required Variables** * `CMAKE_SYSTEM_NAME` must be `Android`, so CMake knows we actually want to cross-compile. * `CMAKE_ANDROID_NDK` must point to the NDK's installation directory, e.g. `/usr/android/ndk` or `c:/android/ndk`. **Recommended Variables** * `CMAKE_ANDROID_STL_TYPE` defines the STL implementation to be used. You should use `c++_shared`, although others might work. **Optional Variables** * `CMAKE_SYSTEM_VERSION` can be set to pick a specific SDK version other than the latest. * `CMAKE_ANDROID_ARCH_ABI` defines the target architecture and ABI, for example `armeabi` or `armeabi-v7a`. Based on your system, you might want to enforce a specific generator to prevent issues, e.g. using `MinGW Makefiles`.
This commit is contained in:
parent
0da25a0b87
commit
806813e937
8 changed files with 23 additions and 93 deletions
|
@ -66,7 +66,7 @@ elseif(SFML_OS_ANDROID)
|
|||
endif()
|
||||
|
||||
# find external libraries
|
||||
if(SFML_OS_ANDROID OR SFML_OS_IOS)
|
||||
if(SFML_OS_IOS)
|
||||
if(NOT SFML_OS_IOS)
|
||||
find_host_package(OpenAL REQUIRED)
|
||||
endif()
|
||||
|
|
|
@ -36,7 +36,7 @@ elseif(SFML_OS_IOS)
|
|||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-ios/")
|
||||
elseif(SFML_OS_ANDROID)
|
||||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
|
||||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-android/${ANDROID_ABI}")
|
||||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-android/${CMAKE_ANDROID_ARCH_ABI}")
|
||||
endif()
|
||||
|
||||
# add the SFML sources path
|
||||
|
|
|
@ -116,7 +116,7 @@ if(SFML_OPENGL_ES AND SFML_OS_LINUX)
|
|||
find_package(GLES REQUIRED)
|
||||
include_directories(${EGL_INCLUDE_DIR} ${GLES_INCLUDE_DIR})
|
||||
endif()
|
||||
if(SFML_OS_ANDROID OR SFML_OS_IOS)
|
||||
if(SFML_OS_IOS)
|
||||
find_host_package(Freetype REQUIRED)
|
||||
else()
|
||||
find_package(Freetype REQUIRED)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
#include <string>
|
||||
|
||||
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "sfml-activity", __VA_ARGS__))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue