Browse Source

Add platform versions of the protobuf libraries.

NDK libraries should not be linked in to platform code, so create a
separate version for the platform that is linked against libc++
instead of the NDK STLs.

Bug: 15193147
Change-Id: I3935e5dd3bd99676772a4b9681e275ef3601b855
Dan Albert 11 years ago
parent
commit
68e7e78257
1 changed files with 37 additions and 0 deletions
  1. 37 0
      Android.mk

+ 37 - 0
Android.mk

@@ -243,6 +243,25 @@ LOCAL_NDK_STL_VARIANT := stlport_static
 
 
 include $(BUILD_STATIC_LIBRARY)
 include $(BUILD_STATIC_LIBRARY)
 
 
+# C++ lite library (libc++ flavored for the platform)
+# =======================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libprotobuf-cpp-lite
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+    $(LOCAL_PATH)/android \
+    $(LOCAL_PATH)/src
+
+LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
+
+include $(BUILD_SHARED_LIBRARY)
+
 # C++ full library
 # C++ full library
 # =======================================================
 # =======================================================
 protobuf_cc_full_src_files := \
 protobuf_cc_full_src_files := \
@@ -328,6 +347,24 @@ LOCAL_NDK_STL_VARIANT := gnustl_static
 
 
 include $(BUILD_STATIC_LIBRARY)
 include $(BUILD_STATIC_LIBRARY)
 
 
+# C++ full library - libc++ version for the platform
+# =======================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libprotobuf-cpp-full
+LOCAL_MODULE_TAGS := optional
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
+LOCAL_C_INCLUDES := \
+    $(LOCAL_PATH)/android \
+    external/zlib \
+    $(LOCAL_PATH)/src
+
+LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
+LOCAL_SHARED_LIBRARIES := libz
+
+include $(BUILD_SHARED_LIBRARY)
+
 # Clean temp vars
 # Clean temp vars
 protobuf_cc_full_src_files :=
 protobuf_cc_full_src_files :=