am e388ac10: Merge "Extra protobuf-related support"

* commit 'e388ac10b9dfc39f7578b6d222652926265dcffd':
  Extra protobuf-related support
This commit is contained in:
Jean-Baptiste Queru 2011-01-27 14:25:30 -08:00 committed by Android Git Automerger
commit 6135627140
4 changed files with 10 additions and 0 deletions

View File

@ -273,7 +273,12 @@ ifneq ($(proto_sources),)
proto_sources_fullpath := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(proto_sources))
# By putting the generated java files into $(LOCAL_INTERMEDIATE_SOURCE_DIR), they will be
# automatically found by the java compiling function transform-java-to-classes.jar.
ifneq ($(LOCAL_INTERMEDIATE_SOURCE_DIR),)
proto_java_intemediate_dir := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/proto
else
# LOCAL_INTERMEDIATE_SOURCE_DIR may be not defined in non-java modules.
proto_java_intemediate_dir := $(intermediates)/proto
endif
proto_java_sources_file_stamp := $(proto_java_intemediate_dir)/Proto.stamp
proto_java_sources_dir := $(proto_java_intemediate_dir)/src
@ -285,6 +290,7 @@ $(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_OPTION := --javamicr
else
$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_OPTION := --java_out
endif
$(proto_java_sources_file_stamp): PRIVATE_PROTOC_FLAGS := $(LOCAL_PROTOC_FLAGS)
$(proto_java_sources_file_stamp) : $(proto_sources_fullpath) $(PROTOC)
$(call transform-proto-to-java)

View File

@ -160,6 +160,7 @@ proto_generated_objects := $(patsubst %.cc,%.o, $(proto_generated_cc_sources))
$(proto_generated_cc_sources): PRIVATE_PROTO_INCLUDES := $(TOP)
$(proto_generated_cc_sources): PRIVATE_PROTO_CC_OUTPUT_DIR := $(proto_generated_cc_sources_dir)
$(proto_generated_cc_sources): PRIVATE_PROTOC_FLAGS := $(LOCAL_PROTOC_FLAGS)
$(proto_generated_cc_sources): $(proto_generated_cc_sources_dir)/%.pb.cc: %.proto $(PROTOC)
$(transform-proto-to-cc)

View File

@ -101,6 +101,7 @@ LOCAL_MANIFEST_FILE:=
LOCAL_BUILD_HOST_DEX:=
LOCAL_DEX_PREOPT:=
LOCAL_PROTOC_OPTIMIZE_TYPE:= # lite(default),micro,full
LOCAL_PROTOC_FLAGS:=
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
# iterate over thousands of entries every time.

View File

@ -770,6 +770,7 @@ define transform-proto-to-java
$(hide) $(PROTOC) \
$(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
$(PRIVATE_PROTO_JAVA_OUTPUT_OPTION)=$(PRIVATE_PROTO_JAVA_OUTPUT_DIR) \
$(PRIVATE_PROTOC_FLAGS) \
$(PRIVATE_PROTO_SRC_FILES)
$(hide) touch $@
endef
@ -782,6 +783,7 @@ define transform-proto-to-cc
@echo "Protoc: $@ <= $<"
$(hide) $(PROTOC) \
$(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
$(PRIVATE_PROTOC_FLAGS) \
--cpp_out=$(PRIVATE_PROTO_CC_OUTPUT_DIR) $<
endef