make libprotobuf-cpp-* libs VNDK
libprotobuf-cpp-* libs are VNDK, However, since the '.vendor' prefix is
added before libprotobuf-cpp-* libs are added to my-*-libraries by
LOCAL_PROTOC_OPTIMIZE_TYPE, the clients are still linked against to the
platform version of the protobuf libs. As a result, link type error
occurs.
In order to avoid this, '.vendor' prefix is appended after
my-*-*libraries are all updated.
Test: normal build successfull
Test: add vendor_provided:true to libprotobuf-cpp-* and build successful
with BOARD_VNDK_VERSION=true
Change-Id: I1ed7978f03e0db56b4cbee86e286c0787f7a3afc
diff --git a/core/binary.mk b/core/binary.mk
index e28db7e..8d5a6ef 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -515,37 +515,6 @@
my_asflags += -D__ASSEMBLY__
###########################################################
-## When compiling against the VNDK, use LL-NDK libraries
-###########################################################
-ifneq ($(LOCAL_USE_VNDK),)
- ####################################################
- ## Soong modules may be built twice, once for /system
- ## and once for /vendor. If we're using the VNDK,
- ## switch all soong libraries over to the /vendor
- ## variant.
- ####################################################
- ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
- # Soong-built libraries should always use the .vendor variant
- my_whole_static_libraries := $(addsuffix .vendor,$(my_whole_static_libraries))
- my_static_libraries := $(addsuffix .vendor,$(my_static_libraries))
- my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries))
- my_system_shared_libraries := $(addsuffix .vendor,$(my_system_shared_libraries))
- my_header_libraries := $(addsuffix .vendor,$(my_header_libraries))
- else
- my_whole_static_libraries := $(foreach l,$(my_whole_static_libraries),\
- $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l)))
- my_static_libraries := $(foreach l,$(my_static_libraries),\
- $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l)))
- my_shared_libraries := $(foreach l,$(my_shared_libraries),\
- $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l)))
- my_system_shared_libraries := $(foreach l,$(my_system_shared_libraries),\
- $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l)))
- my_header_libraries := $(foreach l,$(my_header_libraries),\
- $(if $(SPLIT_VENDOR.HEADER_LIBRARIES.$(l)),$(l).vendor,$(l)))
- endif
-endif
-
-###########################################################
## Define PRIVATE_ variables from global vars
###########################################################
ifndef LOCAL_IS_HOST_MODULE
@@ -1343,6 +1312,36 @@
asm_objects += $(asm_objects_asm)
endif
+###########################################################
+## When compiling against the VNDK, use LL-NDK libraries
+###########################################################
+ifneq ($(LOCAL_USE_VNDK),)
+ ####################################################
+ ## Soong modules may be built twice, once for /system
+ ## and once for /vendor. If we're using the VNDK,
+ ## switch all soong libraries over to the /vendor
+ ## variant.
+ ####################################################
+ ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
+ # Soong-built libraries should always use the .vendor variant
+ my_whole_static_libraries := $(addsuffix .vendor,$(my_whole_static_libraries))
+ my_static_libraries := $(addsuffix .vendor,$(my_static_libraries))
+ my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries))
+ my_system_shared_libraries := $(addsuffix .vendor,$(my_system_shared_libraries))
+ my_header_libraries := $(addsuffix .vendor,$(my_header_libraries))
+ else
+ my_whole_static_libraries := $(foreach l,$(my_whole_static_libraries),\
+ $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l)))
+ my_static_libraries := $(foreach l,$(my_static_libraries),\
+ $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l)))
+ my_shared_libraries := $(foreach l,$(my_shared_libraries),\
+ $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l)))
+ my_system_shared_libraries := $(foreach l,$(my_system_shared_libraries),\
+ $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l)))
+ my_header_libraries := $(foreach l,$(my_header_libraries),\
+ $(if $(SPLIT_VENDOR.HEADER_LIBRARIES.$(l)),$(l).vendor,$(l)))
+ endif
+endif
##########################################################
## Set up installed module dependency