From 0c6b813c0508a661601a74a1feca8db7ba06e28f Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Thu, 20 Feb 2020 02:54:45 +0100 Subject: [PATCH] paindroid version fixes --- CMakeLists.txt | 8 +++++--- src/CMakeLists.txt | 29 ++++++++++++++++++++++------- src/common/int-util.h | 6 +++--- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 037ba50c..d7e18190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,8 +186,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(Boost_VERSION "ofxiOSBoost 1.60.0") elseif(CMAKE_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_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/boost_1_68_0-clang/${CMAKE_ANDROID_ARCH_ABI}/lib/") + link_directories("${Boost_LIBRARY_DIRS}") + set(Boost_LIBRARIES "${Boost_LIBRARY_DIRS}libboost_system.a;${Boost_LIBRARY_DIRS}libboost_filesystem.a;${Boost_LIBRARY_DIRS}libboost_thread.a;${Boost_LIBRARY_DIRS}libboost_timer.a;${Boost_LIBRARY_DIRS}libboost_date_time.a;${Boost_LIBRARY_DIRS}libboost_chrono.a;${Boost_LIBRARY_DIRS}libboost_regex.a;${Boost_LIBRARY_DIRS}libboost_serialization.a;${Boost_LIBRARY_DIRS}libboost_atomic.a;${Boost_LIBRARY_DIRS}libboost_program_options.a;${Boost_LIBRARY_DIRS}libboost_locale.a") + # set(Boost_LIBRARIES "libboost_system_w.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) @@ -203,7 +205,7 @@ if(MINGW) set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock") elseif(NOT MSVC) if(NOT APPLE) - set(Boost_LIBRARIES "${Boost_LIBRARIES};rt") + set(Boost_LIBRARIES "${Boost_LIBRARIES};") if(STATIC) message("NOTICE: Including static ICU libraries") set(Boost_LIBRARIES "${Boost_LIBRARIES};icui18n.a;icuuc.a;icudata.a;dl") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a488e07d..9c60eaf0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,17 +98,32 @@ endif() add_library(crypto ${CRYPTO}) -add_library(wallet ${WALLET}) -add_dependencies(wallet version ${PCH_LIB_NAME}) -ENABLE_SHARED_PCH(WALLET) - 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" OR CMAKE_SYSTEM_NAME STREQUAL "Android" ) +if(CMAKE_SYSTEM_NAME STREQUAL "Android" ) + add_library(wallet SHARED ${WALLET}) + add_dependencies(wallet version ${PCH_LIB_NAME}) + target_link_libraries(wallet currency_core crypto common zlibstatic ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) +else() + add_library(wallet ${WALLET}) + add_dependencies(wallet version ${PCH_LIB_NAME}) + ENABLE_SHARED_PCH(WALLET) +endif() + + + + + + +if(CMAKE_SYSTEM_NAME STREQUAL "iOS") install(TARGETS wallet currency_core crypto common DESTINATION lib) - message("Generating for iOS: finished") + message("Generating install for iOS") + return() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + install(TARGETS wallet DESTINATION "${CMAKE_ANDROID_ARCH_ABI}/lib") + message("Generating install for Android") return() endif() @@ -125,7 +140,7 @@ target_link_libraries(currency_core lmdb mdbx) add_executable(daemon ${DAEMON} ${P2P} ${CURRENCY_PROTOCOL}) add_dependencies(daemon version) -target_link_libraries(daemon rpc stratum currency_core crypto common libminiupnpc-static zlibstatic ethash ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) + target_link_libraries(daemon rpc stratum currency_core crypto common libminiupnpc-static zlibstatic ethash ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) ENABLE_SHARED_PCH(DAEMON) ENABLE_SHARED_PCH_EXECUTABLE(daemon) diff --git a/src/common/int-util.h b/src/common/int-util.h index 9eff50be..261fb400 100644 --- a/src/common/int-util.h +++ b/src/common/int-util.h @@ -194,11 +194,11 @@ static inline void memcpy_swap64(void *dst, const void *src, size_t n) { } } -#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN) +#if !defined(__BYTE_ORDER__) || !defined(__ORDER_LITTLE_ENDIAN__) || !defined(__ORDER_BIG_ENDIAN__) static_assert(false, "BYTE_ORDER is undefined. Perhaps, GNU extensions are not enabled"); #endif -#if BYTE_ORDER == LITTLE_ENDIAN +#if __BYTE_ORDER == __ORDER_LITTLE_ENDIAN__ #define SWAP32LE IDENT32 #define SWAP32BE SWAP32 #define swap32le ident32 @@ -217,7 +217,7 @@ static_assert(false, "BYTE_ORDER is undefined. Perhaps, GNU extensions are not e #define memcpy_swap64be memcpy_swap64 #endif -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__ #define SWAP32BE IDENT32 #define SWAP32LE SWAP32 #define swap32be ident32