Revert "Invoke HIDL for C++ files"

This reverts commit 55f704084b.
This commit is contained in:
Iliyan Malchev 2016-08-05 16:07:34 -07:00
parent 5fd1d06433
commit 7ec6abf2d2
5 changed files with 2 additions and 83 deletions

View File

@ -945,39 +945,6 @@ my_generated_sources += $(vts_gen_cpp)
endif # $(vts_src) non-empty
###########################################################
## Compile the .hidl files to .cpp and then to .o
###########################################################
hidl_src := $(strip $(filter %.hidl,$(my_src_files)))
hidl_gen_cpp :=
ifneq ($(hidl_src),)
# Use the intermediates directory to avoid writing our own .cpp -> .o rules.
hidl_gen_cpp_root := $(intermediates)/hidl-generated/src
hidl_gen_include_root := $(intermediates)/hidl-generated/include
# Multi-architecture builds have distinct intermediates directories.
# Thus we'll actually generate source for each architecture.
$(foreach s,$(hidl_src),\
$(eval $(call define-hidl-cpp-rule,$(s),$(hidl_gen_cpp_root),hidl_gen_cpp)))
$(foreach cpp,$(hidl_gen_cpp), \
$(call include-depfile,$(addsuffix .hidl.P,$(basename $(cpp))),$(cpp)))
$(call track-src-file-gen,$(hidl_src),$(hidl_gen_cpp))
$(hidl_gen_cpp) : PRIVATE_MODULE := $(LOCAL_MODULE)
$(hidl_gen_cpp) : PRIVATE_HEADER_OUTPUT_DIR := $(hidl_gen_include_root)
$(hidl_gen_cpp) : PRIVATE_SRC_OUTPUT_DIR := $(hidl_gen_cpp_root)
$(hidl_gen_cpp) : PRIVATE_HIDL_FLAGS := $(addprefix -I,$(LOCAL_HIDL_INCLUDES))
# Add generated headers to include paths.
my_c_includes += $(hidl_gen_include_root)
my_export_c_include_dirs += $(hidl_gen_include_root)
# Pick up the generated C++ files later for transformation to .o files.
my_generated_sources += $(hidl_gen_cpp)
endif # $(hidl_src) non-empty
###########################################################
## YACC: Compile .y/.yy files to .c/.cpp and then to .o.
###########################################################

View File

@ -107,7 +107,6 @@ LOCAL_RES_LIBRARIES:=
LOCAL_MANIFEST_INSTRUMENTATION_FOR:=
LOCAL_AIDL_INCLUDES:=
LOCAL_VTS_INCLUDES:=
LOCAL_HIDL_INCLUDES:=
LOCAL_JARJAR_RULES:=
LOCAL_ADDITIONAL_JAVA_DIR:=
LOCAL_ALLOW_UNDEFINED_SYMBOLS:=
@ -145,7 +144,6 @@ LOCAL_PROTOC_OPTIMIZE_TYPE:= # lite(default),micro,nano,full,nanopb-c,nanopb-c-e
LOCAL_PROTOC_FLAGS:=
LOCAL_PROTO_JAVA_OUTPUT_PARAMS:=
LOCAL_VTSC_FLAGS:=
LOCAL_HIDL_FLAGS:=
LOCAL_NO_CRT:=
LOCAL_NO_LIBCOMPILER_RT:=
LOCAL_NO_LIBGCC:=

View File

@ -543,7 +543,6 @@ NANOPB_SRCS := external/nanopb-c/generator/protoc-gen-nanopb \
external/nanopb-c/generator/google/*.py \
external/nanopb-c/generator/proto/*.py)
VTSC := $(HOST_OUT_EXECUTABLES)/vtsc$(HOST_EXECUTABLE_SUFFIX)
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
DBUS_GENERATOR := $(HOST_OUT_EXECUTABLES)/dbus-binding-generator
MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX)
MINIGZIP := $(HOST_OUT_EXECUTABLES)/minigzip$(HOST_EXECUTABLE_SUFFIX)

View File

@ -319,24 +319,6 @@ define all-subdir-vts-files
$(call all-vts-files-under,.)
endef
###########################################################
## Find all files named "*.hidl" under the named directories,
## which must be relative to $(LOCAL_PATH). The returned list
## is relative to $(LOCAL_PATH).
###########################################################
define all-hidl-files-under
$(call all-named-files-under,*.hidl,$(1))
endef
###########################################################
## Find all of the "*.hidl" files under $(LOCAL_PATH).
###########################################################
define all-subdir-hidl-files
$(call all-hidl-files-under,.)
endef
###########################################################
## Find all of the logtags files under the named directories.
## Meant to be used like:
@ -1166,33 +1148,6 @@ $$(define-vts-cpp-rule-src) : $(LOCAL_PATH)/$(1) $(VTSC)
$(3) += $$(define-vts-cpp-rule-src)
endef
###########################################################
## Commands for running hidl-gen
###########################################################
define transform-hidl-to-cpp
@mkdir -p $(dir $@)
@mkdir -p $(PRIVATE_HEADER_OUTPUT_DIR)
@mkdir -p $(PRIVATE_SRC_OUTPUT_DIR)
@echo "Generating C++ from HIDL: $(PRIVATE_MODULE) <= $<"
$(hide) $(HIDL) -d$(basename $@).hidl.P $(PRIVATE_HIDL_FLAGS) \
all_cpps $< $(PRIVATE_HEADER_OUTPUT_DIR) $@
endef
## Given a .hidl file path generate the rule to compile it to .cpp and .h files.
# $(1): a .hidl source file
# $(2): a directory to place the generated .cpp and .h files in
# $(3): name of a variable to add the path to the generated source files to
#
# You must call this with $(eval).
define define-hidl-cpp-rule
my_tracked_source_files += $@
define-hidl-cpp-rule-src := $(patsubst %.hidl,%$(LOCAL_CPP_EXTENSION),$(subst ../,dotdot/,$(addprefix $(2)/,$(1))))
$$(define-hidl-cpp-rule-src) : $(LOCAL_PATH)/$(1) $(HIDL)
$$(transform-hidl-to-cpp)
$(3) += $$(define-hidl-cpp-rule-src)
endef
###########################################################
## Commands for running java-event-log-tags.py
###########################################################

View File

@ -1162,7 +1162,7 @@ case `uname -s` in
Darwin)
function sgrep()
{
find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|S|java|xml|sh|mk|aidl|vts|hidl)' \
find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|S|java|xml|sh|mk|aidl|vts)' \
-exec grep --color -n "$@" {} +
}
@ -1170,7 +1170,7 @@ case `uname -s` in
*)
function sgrep()
{
find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cc\|cpp\|S\|java\|xml\|sh\|mk\|aidl\|vts\|hidl\)' \
find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cc\|cpp\|S\|java\|xml\|sh\|mk\|aidl\|vts\)' \
-exec grep --color -n "$@" {} +
}
;;