diff --git a/CMakeLists.txt b/CMakeLists.txt index d5f427b6..63b500de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,10 @@ if (UNIX AND NOT APPLE) endif() else() # multi configurations for MSVC and XCode - if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android") + if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(CMAKE_CONFIGURATION_TYPES "Release") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(CMAKE_CONFIGURATION_TYPES "Debug;Release") else() set(CMAKE_CONFIGURATION_TYPES "Debug;Release") endif() @@ -185,9 +187,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(Boost_LIBRARIES "libboost.a") 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/${CMAKE_ANDROID_ARCH_ABI}/lib/") - link_directories("${Boost_LIBRARY_DIRS}") + #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/${CMAKE_ANDROID_ARCH_ABI}/lib/") + set(Boost_INCLUDE_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/1.69.0/include") + set(Boost_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/1.69.0/libs/llvm/${CMAKE_ANDROID_ARCH_ABI}/") + #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") # 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") diff --git a/contrib/epee/include/misc_log_ex.h b/contrib/epee/include/misc_log_ex.h index 31b31e4b..52c0fc3a 100644 --- a/contrib/epee/include/misc_log_ex.h +++ b/contrib/epee/include/misc_log_ex.h @@ -113,10 +113,14 @@ DISABLE_VS_WARNINGS(4100) #endif #define LOG_DEFAULT_CHANNEL NULL +#ifndef ANDROID_BUILD #define ENABLE_CHANNEL_BY_DEFAULT(ch_name) \ static bool COMBINE(init_channel, __LINE__) UNUSED_ATTRIBUTE = epee::misc_utils::static_initializer([](){ \ epee::log_space::log_singletone::enable_channel(ch_name); return true; \ }); +#else + #define ENABLE_CHANNEL_BY_DEFAULT(ch_name) +#endif #if defined(ENABLE_LOGGING_INTERNAL) diff --git a/utils/build_android_libs.sh b/utils/build_android_libs.sh index 81a7746b..750ebf01 100755 --- a/utils/build_android_libs.sh +++ b/utils/build_android_libs.sh @@ -1,13 +1,13 @@ set -x #echo on cd .. rm -r _builds -cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=16 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install +cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 fi -cmake --build _builds --config Release --target install -- -j 4 +cmake --build _builds --config Debug --target install -- -j 4 if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 @@ -19,13 +19,13 @@ if [ $? -ne 0 ]; then exit 1 fi -cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=16 -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install +cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 fi -cmake --build _builds --config Release --target install -- -j 4 +cmake --build _builds --config Debug --target install -- -j 4 if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 @@ -38,13 +38,13 @@ if [ $? -ne 0 ]; then fi -cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=16 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install +cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 fi -cmake --build _builds --config Release --target install -- -j 4 +cmake --build _builds --config Debug --target install -- -j 4 if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 @@ -57,13 +57,13 @@ if [ $? -ne 0 ]; then fi -cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=16 -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install +cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DCMAKE_ANDROID_NDK=/Users/roky/Library/Android/sdk/ndk/18.1.5063045 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_INSTALL_PREFIX=`pwd`/_install if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1 fi -cmake --build _builds --config Release --target install -- -j 4 +cmake --build _builds --config Debug --target install -- -j 4 if [ $? -ne 0 ]; then echo "Failed to perform command" exit 1