shithub: openh264

Download patch

ref: 5a9ee4e4cfc58225a56e7a21ee31f05a78dabb76
parent: 1ddfe902c6fd34f75f91f9fc9b2696f921ca603b
author: guangwwa <guangwwa@cisco.com>
date: Wed Feb 26 05:07:10 EST 2020

fix ut build issue for android

--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -49,6 +49,7 @@
 CXXFLAGS += -fno-rtti -fno-exceptions
 LDFLAGS += --sysroot=$(SYSROOT)
 SHLDFLAGS = -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -Wl,-soname,lib$(PROJECT_NAME).so
+UTSHLDFLAGS = -Wl,-soname,libut.so
 
 ifeq ($(NDK_TOOLCHAIN_VERSION), clang)
   HOST_OS = $(shell uname -s | tr [A-Z] [a-z])
@@ -70,9 +71,11 @@
 
   CFLAGS += -target $(TARGET_NAME)
   LDFLAGS += -target $(TARGET_NAME) -gcc-toolchain $(GCC_TOOLCHAIN_PATH)
-  LDFLAGS += -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libunwind.a
 endif
 
+# background reading: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#unwinding
+LDFLAGS += -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libunwind.a
+
 ifneq ($(findstring /,$(CXX)),$(findstring \,$(CXX)))
 ifneq ($(CXX),$(wildcard $(CXX)))
 ifneq ($(CXX).exe,$(wildcard $(CXX).exe))
@@ -81,10 +84,18 @@
 endif
 endif
 
+ifeq ($(NDK_TOOLCHAIN_VERSION), clang)
 STL_INCLUDES = \
+    -I$(NDKROOT)/sources/cxx-stl/llvm-libc++/include \
+    -I$(NDKROOT)/sources/cxx-stl/llvm-libc++abi/include
+STL_LIB = \
+    $(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/libc++_static.a
+else
+STL_INCLUDES = \
     -I$(NDKROOT)/sources/cxx-stl/stlport/stlport
 STL_LIB = \
     $(NDKROOT)/sources/cxx-stl/stlport/libs/$(APP_ABI)/libstlport_static.a
+endif
 
 GTEST_INCLUDES = $(STL_INCLUDES)
 CODEC_UNITTEST_INCLUDES = $(STL_INCLUDES)
--- a/test/build/android/jni/Application.mk
+++ b/test/build/android/jni/Application.mk
@@ -1,2 +1,6 @@
+ifeq ($(NDK_TOOLCHAIN_VERSION), clang)
+APP_STL := c++_shared
+else
 APP_STL := stlport_shared
+endif
 APP_PLATFORM := android-12