ref: 2f02bf9626ab3168dc0089c61a84ee5495a836cf
parent: 58b39c97743ac9374d5318762bc58b3ce8cd90f4
author: Martin Storsjö <[email protected]>
date: Thu Feb 20 07:21:14 EST 2014
Link codec_unittest to the static android STL This allows building (and running) codec_unittest for android. This explicitly needs to go at the end of the LDFLAGS, since both this and -lgtest etc. are static libraries, and code in gtest relies on the STL. Since this explicitly needs to be at the end, a separate makefile variable is added for it.
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,7 @@
H264ENC_LDFLAGS = -L. $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common)
H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
-CODEC_UNITTEST_LDFLAGS = -L. $(call LINK_LIB,gtest) $(call LINK_LIB,decoder) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common)
+CODEC_UNITTEST_LDFLAGS = -L. $(call LINK_LIB,gtest) $(call LINK_LIB,decoder) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common) $(CODEC_UNITTEST_LDFLAGS_SUFFIX)
CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
.PHONY: test gtest-bootstrap clean
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -50,6 +50,8 @@
GTEST_INCLUDES = $(STL_INCLUDES)
CODEC_UNITTEST_INCLUDES = $(STL_INCLUDES)
+CODEC_UNITTEST_LDFLAGS_SUFFIX = \
+ $(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCCVERSION)/libs/$(APP_ABI)/libgnustl_static.a
binaries : decdemo encdemo