aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Szczepaniak <pszczepaniak@google.com>2012-11-06 14:47:29 +0000
committerPrzemyslaw Szczepaniak <pszczepaniak@google.com>2012-11-06 15:00:15 +0000
commitc94c4501fe83e3ad77ce597b55bbbfbf533c10ee (patch)
treec034cff3c8dbb6d096ef20c6d456e36f469a1ddd
parent2ee91b4af4353b9e6a9d591c32fedfc58fd4ef35 (diff)
downloadregex-re2-c94c4501fe83e3ad77ce597b55bbbfbf533c10ee.tar.gz
Add gnustl+rtti version of library
Previously, code linked against gnustl could not use this library, due to conflicts with stlport used here. I've added gnustl version, called libregex-re2-gnustl-rtti Bug: 7484202 Change-Id: I951a8d85bb46eefb6da523806632107064b7f12c
-rw-r--r--Android.mk19
-rw-r--r--util/util.h7
2 files changed, 24 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
index f29ae89..0307ce3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,7 +6,6 @@
#
LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
regexp_re2_files := \
util/arena.cc \
@@ -36,6 +35,9 @@ regexp_re2_files := \
re2/unicode_casefold.cc \
re2/unicode_groups.cc
+# Stlport version
+# =======================================================
+include $(CLEAR_VARS)
LOCAL_MODULE := libregex-re2
LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc
@@ -44,3 +46,18 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/re2 \
LOCAL_SRC_FILES := $(regexp_re2_files)
include external/stlport/libstlport.mk
include $(BUILD_STATIC_LIBRARY)
+
+# Gnustl+rtti version
+# =======================================================
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libregex-re2-gnustl-rtti
+LOCAL_MODULE_TAGS := optional
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/re2
+LOCAL_SRC_FILES := $(regexp_re2_files)
+LOCAL_CFLAGS += -frtti
+LOCAL_NDK_STL_VARIANT := gnustl_static
+LOCAL_SDK_VERSION := 14
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/util/util.h b/util/util.h
index 5948ef6..bf897ae 100644
--- a/util/util.h
+++ b/util/util.h
@@ -42,7 +42,12 @@ using std::make_pair;
#if defined(ANDROID)
-#include <unordered_set>
+#if defined(_STLPORT_VERSION)
+#include <unordered_set> // using stlport
+#else
+#include <tr1/unordered_set> // using gnustl
+#endif
+
using std::tr1::unordered_set;
#elif defined(__GNUC__) && !defined(USE_CXX0X)