OSDN Git Service

binary: Generate dummy rule for relocated protobuf headers
authorRicardo Cerqueira <ricardo@cyngn.com>
Fri, 26 Feb 2016 18:06:39 +0000 (18:06 +0000)
committerSteve Kondik <steve@cyngn.com>
Sun, 4 Sep 2016 04:47:36 +0000 (21:47 -0700)
Similar to (and dependent on) the rule already in place for pb
headers, to avoid dependency breakage when builds are interrupted
for random reasons

Change-Id: Ie88f468f8a5b0d240121db6791a1053c4a7c5bfb

core/binary.mk

index 28fe3df..be0feae 100644 (file)
@@ -700,6 +700,17 @@ $(proto_generated_headers): $(proto_generated_sources_dir)/%.pb.h: $(proto_gener
        $(hide) touch $@
        $(copy-proto-files)
 
+$(if $(LOCAL_PROTOC_OUTPUT), \
+$(if $(call streq,$(LOCAL_PROTOC_OUTPUT),$(LOCAL_PATH)),, \
+  $(eval proto_relocated_headers := $(subst $(LOCAL_PATH),$(LOCAL_PROTOC_OUTPUT),$(proto_generated_headers))) \
+ ), )
+
+ifdef proto_relocated_headers
+$(proto_relocated_headers): $(proto_generated_headers)
+       echo "Refreshed header file $@."
+       $(hide) touch $@
+endif
+
 $(my_prefix)_$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_proto_defined := true
 endif  # transform-proto-to-cc rule included only once