CMake: update for latest Android NDK; fix missing Android sources

This commit is contained in:
rdb 2019-03-17 21:16:08 +01:00
parent 617ef48346
commit d44b090ecd
3 changed files with 24 additions and 6 deletions

View File

@ -12,7 +12,7 @@ include(CMakeDependentOption)
# The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN"
# are automatically provided by CMAKE. "APPLE" is also provided by
# CMAKE but may be True on systems that are not OS X.
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
set(IS_LINUX 1)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
@ -378,14 +378,14 @@ set(ANDROID_NDK_HOME "" CACHE STRING
"The location of the Android NDK directory. ANDROID_NDK_HOME may
not contain any spaces.")
set(ANDROID_ABI "armeabi" CACHE STRING
"Can be be set to armeabi, armeabi-v7a, x86, or mips,
set(ANDROID_ABI "armeabi-v7a" CACHE STRING
"Can be be set to armeabi-v7a, arm64-v8a, x86, or x86_64,
depending on which architecture should be targeted.")
set_property(CACHE ANDROID_ABI PROPERTY STRINGS
armeabi armeabi-v7a x86 mips)
armeabi-v7a arm64-v8a x86 x86_64)
set(ANDROID_STL "gnustl_shared" CACHE STRING "")
set(ANDROID_PLATFORM "android-9" CACHE STRING "")
set(ANDROID_STL "c++_shared" CACHE STRING "")
set(ANDROID_PLATFORM "android-14" CACHE STRING "")
set(ANDROID_ARCH "arm" CACHE STRING "")
if(ANDROID_ARCH STREQUAL "arm")
set(ANDROID_TOOLCHAIN "arm-linux-androideabi")

View File

@ -63,6 +63,11 @@ set(P3PRC_SOURCES
reversedNumericData.cxx
streamReader.cxx streamWrapper.cxx streamWriter.cxx)
if(ANDROID)
set(P3PRC_SOURCES ${P3PRC_SOURCES}
androidLogStream.cxx)
endif()
set(P3PRC_IGATEEXT
streamReader_ext.cxx
streamReader_ext.h
@ -77,6 +82,10 @@ target_include_directories(p3prc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY
target_link_libraries(p3prc p3dtool PKG::OPENSSL)
target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT})
if(ANDROID)
target_link_libraries(p3prc log)
endif()
if(NOT BUILD_METALIBS)
install(TARGETS p3prc
EXPORT Core COMPONENT Core

View File

@ -118,6 +118,11 @@ set(P3EXPRESS_SOURCES
windowsRegistry.cxx
zStream.cxx zStreamBuf.cxx)
if(ANDROID)
set(P3EXPRESS_SOURCES ${P3EXPRESS_SOURCES}
virtualFileMountAndroidAsset.cxx)
endif()
set(P3EXPRESS_IGATEEXT
datagram_ext.h
memoryUsagePointers_ext.cxx
@ -143,6 +148,10 @@ if(WIN32)
target_link_libraries(p3express advapi32.lib ws2_32.lib)
endif()
if(ANDROID)
target_link_libraries(p3express android)
endif()
if(NOT BUILD_METALIBS)
install(TARGETS p3express
EXPORT Core COMPONENT Core