forked from lthn/blockchain
disabled unlinked utf8 functions for android, chaged libs to static
This commit is contained in:
parent
c18c6230cf
commit
7b12ce6e9f
5 changed files with 101 additions and 4 deletions
|
|
@ -103,7 +103,7 @@ add_dependencies(currency_core version ${PCH_LIB_NAME})
|
|||
ENABLE_SHARED_PCH(CURRENCY_CORE)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Android" )
|
||||
add_library(wallet SHARED ${WALLET})
|
||||
add_library(wallet ${WALLET})
|
||||
add_dependencies(wallet version ${PCH_LIB_NAME})
|
||||
target_link_libraries(wallet currency_core crypto common zlibstatic ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES})
|
||||
else()
|
||||
|
|
@ -122,7 +122,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
|||
message("Generating install for iOS")
|
||||
return()
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
install(TARGETS wallet DESTINATION "${CMAKE_ANDROID_ARCH_ABI}/lib")
|
||||
install(TARGETS wallet currency_core crypto common zlibstatic DESTINATION "${CMAKE_ANDROID_ARCH_ABI}/lib")
|
||||
message("Generating install for Android")
|
||||
return()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -595,9 +595,11 @@ namespace currency
|
|||
//---------------------------------------------------------------
|
||||
std::ostream& operator <<(std::ostream& o, const ref_by_id& r);
|
||||
//---------------------------------------------------------------
|
||||
#ifndef ANDROID_BUILD
|
||||
std::string utf8_to_upper(const std::string& s);
|
||||
std::string utf8_to_lower(const std::string& s);
|
||||
bool utf8_substring_test_case_insensitive(const std::string& match, const std::string& s); // Returns true is 's' contains 'match' (case-insensitive)
|
||||
#endif
|
||||
|
||||
struct difficulties
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,11 @@ namespace bc_services
|
|||
//------------------------------------------------------------------
|
||||
bool order_offers_by_name(const offer_details_ex* a, const offer_details_ex* b)
|
||||
{
|
||||
#ifndef ANDROID_BUILD
|
||||
return currency::utf8_to_lower(a->target) < currency::utf8_to_lower(b->target);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
std::vector<sort_offers_func_type> gsort_offers_predicates;
|
||||
|
|
|
|||
|
|
@ -191,8 +191,21 @@ namespace bc_services
|
|||
inline double extract_rate(const odeh& v) { return calculate_offer_rate(v); }
|
||||
inline size_t extract_payment_types(const odeh& v) { return v.payment_types.size(); }
|
||||
inline std::string extract_contacts(const odeh& v) { return v.contacts; }
|
||||
inline std::string extract_location(const odeh& v) { return currency::utf8_to_lower(v.location_country + v.location_city); }
|
||||
inline std::string extract_name(const odeh& v) { return currency::utf8_to_lower(v.target); }
|
||||
inline std::string extract_location(const odeh& v) {
|
||||
|
||||
#ifndef ANDROID_BUILD
|
||||
return currency::utf8_to_lower(v.location_country + v.location_city);
|
||||
#else
|
||||
return "UNSUPORTED";
|
||||
#endif
|
||||
}
|
||||
inline std::string extract_name(const odeh& v) {
|
||||
#ifndef ANDROID_BUILD
|
||||
return currency::utf8_to_lower(v.target);
|
||||
#else
|
||||
return "UNSUPORTED";
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int sort_type>
|
||||
struct sort_id_to_type
|
||||
|
|
|
|||
78
utils/build_android_libs.sh
Normal file
78
utils/build_android_libs.sh
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
set -x #echo on
|
||||
cd ..
|
||||
rm -r _builds
|
||||
cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=28 -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
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -r _builds
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=28 -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
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -r _builds
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=28 -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
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -r _builds
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
cmake -S. -B_builds -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=28 -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
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -r _builds
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to perform command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Loading…
Add table
Reference in a new issue