mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 02:36:09 +00:00
Improved build rule generation for Android flatbuffer headers.
* Added the ability to create a build target for generated headers. * Made it possible for generated header targets to depend upon each other or arbitrary build targets. Tested: Verified some pretty complex libraries with numerous flatbuffer schema dependencies build using this macro on Linux with the NDK. Bug: 25188384 Change-Id: I846855a50808e58c34cdf7086e93e7ea0df69e0d
This commit is contained in:
@@ -164,7 +164,18 @@ $(eval \
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
# $(flatbuffers_header_build_rules schema_files,schema_dir,output_dir,\
|
# $(flatbuffers_header_build_rules schema_files,schema_dir,output_dir,\
|
||||||
# schema_include_dirs,src_files))
|
# schema_include_dirs,src_files,[build_target],[dependencies]))
|
||||||
|
#
|
||||||
|
# $(1) schema_files: Space separated list of flatbuffer schema files.
|
||||||
|
# $(2) schema_dir: Directory containing the flatbuffer schemas.
|
||||||
|
# $(3) output_dir: Where to place the generated files.
|
||||||
|
# $(4) schema_include_dirs: Directories to include when generating schemas.
|
||||||
|
# $(5) src_files: Files that should depend upon the headers generated from the
|
||||||
|
# flatbuffer schemas.
|
||||||
|
# $(6) build_target: Name of a build target that depends upon all generated
|
||||||
|
# headers.
|
||||||
|
# $(7) dependencies: Space seperated list of additional build targets src_files
|
||||||
|
# should depend upon.
|
||||||
#
|
#
|
||||||
# Use this in your own Android.mk file to generate build rules that will
|
# Use this in your own Android.mk file to generate build rules that will
|
||||||
# generate header files for your flatbuffer schemas as well as automatically
|
# generate header files for your flatbuffer schemas as well as automatically
|
||||||
@@ -180,7 +191,17 @@ $(foreach schema,$(1),\
|
|||||||
$(foreach src,$(strip $(5)),\
|
$(foreach src,$(strip $(5)),\
|
||||||
$(eval $(PORTABLE_LOCAL_PATH)$$(src): \
|
$(eval $(PORTABLE_LOCAL_PATH)$$(src): \
|
||||||
$(foreach schema,$(strip $(1)),\
|
$(foreach schema,$(strip $(1)),\
|
||||||
$(call flatbuffers_fbs_to_h,$(strip $(2)),$(strip $(3)),$(schema)))))
|
$(call flatbuffers_fbs_to_h,$(strip $(2)),$(strip $(3)),$(schema)))))\
|
||||||
|
$(if $(6),\
|
||||||
|
$(foreach schema,$(strip $(1)),\
|
||||||
|
$(eval $(6): \
|
||||||
|
$(call flatbuffers_fbs_to_h,$(strip $(2)),$(strip $(3)),$(schema)))),)\
|
||||||
|
$(if $(7),\
|
||||||
|
$(foreach src,$(strip $(5)),\
|
||||||
|
$(eval $(PORTABLE_LOCAL_PATH)$$(src): $(strip $(7)))),)\
|
||||||
|
$(if $(7),\
|
||||||
|
$(foreach dependency,$(strip $(7)),\
|
||||||
|
$(eval $(6): $(dependency))),)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
endif # FLATBUFFERS_INCLUDE_MK_
|
endif # FLATBUFFERS_INCLUDE_MK_
|
||||||
|
|||||||
Reference in New Issue
Block a user