]> sigrok.org Git - sigrok-util.git/commitdiff
sigrok-cross-android: Link pulseview against gnustl_shared
authorMarcus Comstedt <redacted>
Sun, 27 Nov 2016 15:03:28 +0000 (16:03 +0100)
committerMarcus Comstedt <redacted>
Sun, 27 Nov 2016 15:03:34 +0000 (16:03 +0100)
This fixes parts of bug #701.

cross-compile/android/android.toolchain.cmake.patch

index 79b97ed91f8e43779fb137e00b42b855f4901242..4b46c8a558106086cbe086af3f9102c837c9db49 100644 (file)
@@ -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()\r
    execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version\r
     OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )\r
@@ -9,13 +9,13 @@
   endif()\r
  endif()\r
  \r
-@@ -667,7 +667,12 @@ endif()
+@@ -667,7 +667,12 @@
  if( BUILD_WITH_STANDALONE_TOOLCHAIN )\r
   set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )\r
   set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )\r
 - set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )\r
 + if (NOT DEFINED ANDROID_STL_PATH)\r
-+  set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )\r
++   set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )\r
 + else()\r
 +   set( __stlIncludePath "${ANDROID_STL_PATH}/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/include" )\r
 +   set( __stlLibPath "${ANDROID_STL_PATH}/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}" )\r
@@ -23,7 +23,7 @@
  endif()\r
  if( BUILD_WITH_ANDROID_NDK )\r
   set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )\r
-@@ -732,6 +737,9 @@ list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS
+@@ -732,6 +737,9 @@
  if( __stlIncludePath AND EXISTS "${__stlIncludePath}" )\r
   list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${__stlIncludePath}" )\r
  endif()\r
  \r
  # c++ bits includes\r
  if( __stlLibPath AND EXISTS "${__stlLibPath}/include" )\r
+@@ -873,7 +881,10 @@
+   set( CMAKE_CXX_CREATE_SHARED_MODULE  "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> \"${__stlLibPath}/libstlport_static.a\"")\r
+  endif()\r
+ else( ANDROID_USE_STLPORT )\r
+- if( EXISTS "${__stlLibPath}/libgnustl_static.a" )\r
++ if( EXISTS "${__stlLibPath}/libgnustl_shared.so" )\r
++    list( APPEND ANDROID_SYSTEM_LIB_DIRS "${__stlLibPath}" )\r
++    set(CMAKE_CXX_STANDARD_LIBRARIES "-lgnustl_shared")\r
++ elseif( EXISTS "${__stlLibPath}/libgnustl_static.a" )\r
+   __COPY_IF_DIFFERENT( "${__stlLibPath}/libgnustl_static.a" "${__ndklibspath}/libstdc++.a" )\r
+  elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )\r
+   __COPY_IF_DIFFERENT( "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" "${__ndklibspath}/libstdc++.a" )\r