summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorStewart Miles <smiles@google.com>2015-11-12 21:12:18 -0800
committerStewart Miles <smiles@google.com>2015-11-13 08:49:00 -0800
commitef53aebf9e985ac18e931752d017a56705d3619f (patch)
tree1cbc5bc12465faa0c52ad8f708387cc012395143 /android
parent4f96603e129b5a1b5c05965f15afe478530654ac (diff)
downloadflatbuffers-ef53aebf9e985ac18e931752d017a56705d3619f.tar.gz
flatbuffers-ef53aebf9e985ac18e931752d017a56705d3619f.tar.bz2
flatbuffers-ef53aebf9e985ac18e931752d017a56705d3619f.zip
Expand local file path to allow users to fix ndk-build
local-source-file-path does not expand to correct file paths in some circumstances so some users override it. Therefore flatbuffers_header_build_rules has been modified to generate rules that expand LOCAL_SRC_FILES values with flatbuffers_header_build_rules. Also, this overrides local-source-file-path to allow nest projects to build when NDK_OUT is set. Tested: Verified a dependent project continues to build. Bug: 25673744 Change-Id: Ic90186fe96d6e4533f9f3b7ca9ef78084de08a7e
Diffstat (limited to 'android')
-rw-r--r--android/jni/include.mk11
1 files changed, 9 insertions, 2 deletions
diff --git a/android/jni/include.mk b/android/jni/include.mk
index 417f6670..02d345e4 100644
--- a/android/jni/include.mk
+++ b/android/jni/include.mk
@@ -192,7 +192,7 @@ $(foreach schema,$(1),\
$(call flatbuffers_header_build_rule,\
$(schema),$(strip $(2)),$(strip $(3)),$(strip $(4))))\
$(foreach src,$(strip $(5)),\
- $(eval $(PORTABLE_LOCAL_PATH)$$(src): \
+ $(eval $(call local-source-file-path,$(src)): \
$(foreach schema,$(strip $(1)),\
$(call flatbuffers_fbs_to_h,$(strip $(2)),$(strip $(3)),$(schema)))))\
$(if $(6),\
@@ -201,11 +201,18 @@ $(if $(6),\
$(call flatbuffers_fbs_to_h,$(strip $(2)),$(strip $(3)),$(schema)))),)\
$(if $(7),\
$(foreach src,$(strip $(5)),\
- $(eval $(PORTABLE_LOCAL_PATH)$$(src): $(strip $(7)))),)\
+ $(eval $(call local-source-file-path,$(src)): $(strip $(7)))),)\
$(if $(7),\
$(foreach dependency,$(strip $(7)),\
$(eval $(6): $(dependency))),)
endef
+# TODO: Remove when the LOCAL_PATH expansion bug in the NDK is fixed.
+# Override the default behavior of local-source-file-path to workaround
+# a bug which prevents the build of deeply nested projects when NDK_OUT is
+# set.
+local-source-file-path = \
+ $(if $(call host-path-is-absolute,$1),$1,$(realpath $(LOCAL_PATH)/$1))
+
endif # FLATBUFFERS_INCLUDE_MK_