Android-related changes(dirty) for native library

This commit is contained in:
cryptozoidberg 2020-02-18 07:05:02 +01:00
parent 0a1f87bc14
commit fa3c922c6f
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
4 changed files with 30 additions and 20 deletions

View file

@ -13,8 +13,13 @@ set(VERSION "1.0")
# cmake_policy(SET CMP0020 OLD)
# endif()
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DIOS_BUILD)
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
message("Android sdk prefix: ${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}")
message("Android CMAKE_CXX_COMPILER prefix: ${CMAKE_CXX_COMPILER}")
message("Android ANDROID_LD: ${ANDROID_LD}")
endif()
endif()
@ -28,7 +33,7 @@ if (UNIX AND NOT APPLE)
endif()
else()
# multi configurations for MSVC and XCode
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
set(CMAKE_CONFIGURATION_TYPES "Release")
else()
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
@ -97,12 +102,12 @@ else()
endif()
# Since gcc 4.9 the LTO format is non-standard (slim), so we need the gcc-specific ar and ranlib binaries
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0))
set(CMAKE_AR "gcc-ar")
set(CMAKE_RANLIB "gcc-ranlib")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT APPLE)
set(CMAKE_AR "llvm-ar")
set(CMAKE_RANLIB "llvm-ranlib")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) AND NOT (MAKE_SYSTEM_NAME STREQUAL "Android"))
## set(CMAKE_AR "gcc-ar")
## set(CMAKE_RANLIB "gcc-ranlib")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT APPLE AND NOT (MAKE_SYSTEM_NAME STREQUAL "Android"))
## set(CMAKE_AR "llvm-ar")
## set(CMAKE_RANLIB "llvm-ranlib")
endif()
@ -170,15 +175,20 @@ if(STATIC)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(Boost_INCLUDE_DIRS "/Users/roky/projects/Zano/mobile_repo/ofxiOSBoost/libs/boost/include")
set(Boost_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/ofxiOSBoost/libs/boost/ios/")
set(Boost_LIBRARIES "libboost.a")
set(Boost_VERSION "ofxiOSBoost 1.60.0")
else()
find_package(Boost 1.55 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
endif()
#message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
#if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
# set(Boost_INCLUDE_DIRS "/Users/roky/projects/Zano/mobile_repo/ofxiOSBoost/libs/boost/include")
# set(Boost_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/ofxiOSBoost/libs/boost/ios/")
# set(Boost_LIBRARIES "libboost.a")
# set(Boost_VERSION "ofxiOSBoost 1.60.0")
#elseif(MAKE_SYSTEM_NAME STREQUAL "Android")
set(Boost_INCLUDE_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/boost_1_68_0-clang/include")
set(Boost_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/boost_1_68_0-clang/armeabi-v7a/lib")
set(Boost_LIBRARIES "libboost_system.a libboost_filesystem.a libboost_thread.a libboost_timer.a libboost_date_time.a libboost_chrono.a libboost_regex.a libboost_serialization.a libboost_atomic.a libboost_program_options.a libboost_locale.a")
set(Boost_VERSION "PurpleI2PBoost 1.68.0")
# else()
# find_package(Boost 1.55 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
#endif()

View file

@ -6,7 +6,7 @@ add_subdirectory(db)
add_subdirectory(ethereum)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
message("excluded upnp support for IOS build")
return()
endif()

View file

@ -1,6 +1,6 @@
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
message("excluded db support for IOS build")
return()
endif()

View file

@ -106,7 +106,7 @@ add_library(currency_core ${CURRENCY_CORE})
add_dependencies(currency_core version ${PCH_LIB_NAME})
ENABLE_SHARED_PCH(CURRENCY_CORE)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android" )
install(TARGETS wallet currency_core crypto common DESTINATION lib)
message("Generating for iOS: finished")
return()