From: Marcus Comstedt Date: Sun, 27 Nov 2016 15:03:28 +0000 (+0100) Subject: sigrok-cross-android: Link pulseview against gnustl_shared X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4ac0f817523c61646aa4fa1948f6d0b455dde7af;p=sigrok-util.git sigrok-cross-android: Link pulseview against gnustl_shared This fixes parts of bug #701. --- diff --git a/cross-compile/android/android.toolchain.cmake.patch b/cross-compile/android/android.toolchain.cmake.patch index 79b97ed..4b46c8a 100644 --- a/cross-compile/android/android.toolchain.cmake.patch +++ b/cross-compile/android/android.toolchain.cmake.patch @@ -1,6 +1,6 @@ --- android.toolchain.cmake.orig 2014-04-06 16:08:25.765699476 +0200 +++ android.toolchain.cmake 2014-04-06 16:22:30.671987319 +0200 -@@ -464,7 +464,7 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN ) +@@ -464,7 +464,7 @@ else() execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -9,13 +9,13 @@ endif() endif() -@@ -667,7 +667,12 @@ endif() +@@ -667,7 +667,12 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN ) set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" ) set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" ) - set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" ) + if (NOT DEFINED ANDROID_STL_PATH) -+ set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" ) ++ set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" ) + else() + set( __stlIncludePath "${ANDROID_STL_PATH}/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/include" ) + set( __stlLibPath "${ANDROID_STL_PATH}/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}" ) @@ -23,7 +23,7 @@ endif() if( BUILD_WITH_ANDROID_NDK ) set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" ) -@@ -732,6 +737,9 @@ list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS +@@ -732,6 +737,9 @@ if( __stlIncludePath AND EXISTS "${__stlIncludePath}" ) list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${__stlIncludePath}" ) endif() @@ -33,3 +33,15 @@ # c++ bits includes if( __stlLibPath AND EXISTS "${__stlLibPath}/include" ) +@@ -873,7 +881,10 @@ + set( CMAKE_CXX_CREATE_SHARED_MODULE " -o \"${__stlLibPath}/libstlport_static.a\"") + endif() + else( ANDROID_USE_STLPORT ) +- if( EXISTS "${__stlLibPath}/libgnustl_static.a" ) ++ if( EXISTS "${__stlLibPath}/libgnustl_shared.so" ) ++ list( APPEND ANDROID_SYSTEM_LIB_DIRS "${__stlLibPath}" ) ++ set(CMAKE_CXX_STANDARD_LIBRARIES "-lgnustl_shared") ++ elseif( EXISTS "${__stlLibPath}/libgnustl_static.a" ) + __COPY_IF_DIFFERENT( "${__stlLibPath}/libgnustl_static.a" "${__ndklibspath}/libstdc++.a" ) + elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" ) + __COPY_IF_DIFFERENT( "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" "${__ndklibspath}/libstdc++.a" )