OSDN Git Service

Use platform protobuf unless building with NDK.
authorDan Albert <danalbert@google.com>
Tue, 11 Nov 2014 18:42:17 +0000 (10:42 -0800)
committerDan Albert <danalbert@google.com>
Tue, 11 Nov 2014 19:05:27 +0000 (11:05 -0800)
The NDK protobuf library depends on the final target linking stlport
(since it is a static library). Since the platform stlport is going
away, we need to use a separate version of the protobuf library that
is compiled for the platform against libc++.

Note that this should be the case for _all_ libraries built with the
NDK. If a library needs to be used by both an NDK built final target
and a platform built final target, there should be both an NDK and
platform version of the library.

Bug: 15193147
Change-Id: I0ead61c2d1cd9d0248b304ab7d8682dedd6e8366

core/binary.mk

index 122c4f5..455c64b 100644 (file)
@@ -561,13 +561,23 @@ ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),full)
         $(warning Stripping unneeded dependency on libprotobuf-cpp-2.3.0-full in $(LOCAL_MODULE))
         my_static_libraries := $(filter-out libprotobuf-cpp-2.3.0-full,$(my_static_libraries))
     endif
-    my_static_libraries += libprotobuf-cpp-full
+
+    ifdef LOCAL_SDK_VERSION
+        my_static_libraries += libprotobuf-cpp-full
+    else
+        my_shared_libraries += libprotobuf-cpp-full
+    endif
 else
     ifneq ($(filter libprotobuf-cpp-2.3.0-lite,$(my_static_libraries)),)
         $(warning Stripping unneeded dependency on libprotobuf-cpp-2.3.0-lite in $(LOCAL_MODULE))
         my_static_libraries := $(filter-out libprotobuf-cpp-2.3.0-lite,$(my_static_libraries))
     endif
-    my_static_libraries += libprotobuf-cpp-lite
+
+    ifdef LOCAL_SDK_VERSION
+        my_static_libraries += libprotobuf-cpp-lite
+    else
+        my_shared_libraries += libprotobuf-cpp-lite
+    endif
 endif
 endif  # $(proto_sources) non-empty