Changes excluded by Copybara

PiperOrigin-RevId: 328408665
Change-Id: I86fb74f6eac377afeca2b65df067352dc17e0168
This commit is contained in:
A. Unique TensorFlower 2020-08-25 14:51:27 -07:00 committed by TensorFlower Gardener
parent 9c974ca45d
commit f5cb94eae2
14 changed files with 68 additions and 1 deletions

View File

@ -17,6 +17,7 @@ load(
"tf_kernel_library", "tf_kernel_library",
) )
load("//tensorflow:tensorflow.bzl", "tf_version_info_genrule") load("//tensorflow:tensorflow.bzl", "tf_version_info_genrule")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
load( load(
"//third_party/mkl:build_defs.bzl", "//third_party/mkl:build_defs.bzl",
"mkl_deps", "mkl_deps",
@ -364,6 +365,7 @@ filegroup(
tf_version_info_genrule( tf_version_info_genrule(
name = "version_info_gen", name = "version_info_gen",
out = "version_info.cc", out = "version_info.cc",
compatible_with = get_compatible_with_portable(),
) )
cc_library( cc_library(
@ -507,6 +509,7 @@ cc_library(
name = "version_info", name = "version_info",
srcs = ["version_info.cc"], srcs = ["version_info.cc"],
hdrs = ["//tensorflow/core/public:version.h"], hdrs = ["//tensorflow/core/public:version.h"],
compatible_with = get_compatible_with_portable(),
copts = tf_copts(), copts = tf_copts(),
alwayslink = if_static(0, 1), alwayslink = if_static(0, 1),
) )

View File

@ -1,6 +1,7 @@
load("//tensorflow:tensorflow.bzl", "if_not_windows", "tf_cc_test") load("//tensorflow:tensorflow.bzl", "if_not_windows", "tf_cc_test")
load("//tensorflow/lite:build_def.bzl", "if_tflite_experimental_runtime", "tflite_cc_shared_object", "tflite_copts", "tflite_experimental_runtime_linkopts") load("//tensorflow/lite:build_def.bzl", "if_tflite_experimental_runtime", "tflite_cc_shared_object", "tflite_copts", "tflite_experimental_runtime_linkopts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
@ -90,6 +91,7 @@ FRAMEWORK_LIB_HDRS = [
cc_library( cc_library(
name = "version", name = "version",
hdrs = ["version.h"], hdrs = ["version.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
# Note that we only use the header defines from :version_lib. # Note that we only use the header defines from :version_lib.
deps = ["//tensorflow/core:version_lib"], deps = ["//tensorflow/core:version_lib"],
@ -107,6 +109,7 @@ cc_library(
name = "arena_planner", name = "arena_planner",
srcs = ["arena_planner.cc"], srcs = ["arena_planner.cc"],
hdrs = ["arena_planner.h"], hdrs = ["arena_planner.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = [ deps = [
":graph_info", ":graph_info",
@ -145,6 +148,7 @@ cc_library(
name = "external_cpu_backend_context", name = "external_cpu_backend_context",
srcs = ["external_cpu_backend_context.cc"], srcs = ["external_cpu_backend_context.cc"],
hdrs = ["external_cpu_backend_context.h"], hdrs = ["external_cpu_backend_context.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = [ deps = [
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",
@ -154,6 +158,7 @@ cc_library(
cc_library( cc_library(
name = "graph_info", name = "graph_info",
hdrs = ["graph_info.h"], hdrs = ["graph_info.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = ["//tensorflow/lite/c:common"], deps = ["//tensorflow/lite/c:common"],
) )
@ -161,6 +166,7 @@ cc_library(
cc_library( cc_library(
name = "memory_planner", name = "memory_planner",
hdrs = ["memory_planner.h"], hdrs = ["memory_planner.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = ["//tensorflow/lite/c:common"], deps = ["//tensorflow/lite/c:common"],
) )
@ -169,6 +175,7 @@ cc_library(
name = "simple_memory_arena", name = "simple_memory_arena",
srcs = ["simple_memory_arena.cc"], srcs = ["simple_memory_arena.cc"],
hdrs = ["simple_memory_arena.h"], hdrs = ["simple_memory_arena.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = ["//tensorflow/lite/c:common"], deps = ["//tensorflow/lite/c:common"],
) )
@ -188,6 +195,7 @@ cc_library(
"builtin_ops.h", "builtin_ops.h",
"context_util.h", "context_util.h",
], ],
compatible_with = get_compatible_with_portable(),
deps = ["//tensorflow/lite/c:common"], deps = ["//tensorflow/lite/c:common"],
) )
@ -198,6 +206,7 @@ cc_library(
hdrs = [ hdrs = [
"string_type.h", "string_type.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
) )
@ -219,6 +228,7 @@ cc_library(
hdrs = [ hdrs = [
"allocation.h", "allocation.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = [ deps = [
":string", ":string",
@ -240,6 +250,7 @@ cc_library(
"stderr_reporter.cc", "stderr_reporter.cc",
], ],
hdrs = FRAMEWORK_LIB_HDRS, hdrs = FRAMEWORK_LIB_HDRS,
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + TFLITE_DEFAULT_COPTS, copts = tflite_copts() + TFLITE_DEFAULT_COPTS,
visibility = [ visibility = [
"//tensorflow/lite:__subpackages__", "//tensorflow/lite:__subpackages__",
@ -280,6 +291,7 @@ cc_library(
srcs = [ srcs = [
], ],
hdrs = FRAMEWORK_LIB_HDRS, hdrs = FRAMEWORK_LIB_HDRS,
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + TFLITE_DEFAULT_COPTS, copts = tflite_copts() + TFLITE_DEFAULT_COPTS,
defines = if_tflite_experimental_runtime( defines = if_tflite_experimental_runtime(
if_eager = ["TFLITE_EXPERIMENTAL_RUNTIME_EAGER"], if_eager = ["TFLITE_EXPERIMENTAL_RUNTIME_EAGER"],
@ -312,6 +324,7 @@ cc_library(
name = "string_util", name = "string_util",
srcs = ["string_util.cc"], srcs = ["string_util.cc"],
hdrs = ["string_util.h"], hdrs = ["string_util.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS, copts = TFLITE_DEFAULT_COPTS,
deps = [ deps = [
":string", ":string",
@ -356,6 +369,7 @@ cc_library(
cc_library( cc_library(
name = "tflite_with_xnnpack_default", name = "tflite_with_xnnpack_default",
compatible_with = get_compatible_with_portable(),
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
# TODO(b/151246885): put ":tflite_with_xnnpack_enabled" to macos/windows # TODO(b/151246885): put ":tflite_with_xnnpack_enabled" to macos/windows
# once we have a good testing coverage on these two platforms. # once we have a good testing coverage on these two platforms.
@ -373,6 +387,7 @@ cc_library(
"core/macros.h", "core/macros.h",
"tflite_with_xnnpack_optional.h", "tflite_with_xnnpack_optional.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + TFLITE_DEFAULT_COPTS, copts = tflite_copts() + TFLITE_DEFAULT_COPTS,
deps = [ deps = [
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",
@ -568,6 +583,7 @@ cc_library(
name = "util", name = "util",
srcs = ["util.cc"], srcs = ["util.cc"],
hdrs = ["util.h"], hdrs = ["util.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS + tflite_copts(), copts = TFLITE_DEFAULT_COPTS + tflite_copts(),
deps = [ deps = [
":kernel_api", ":kernel_api",
@ -611,6 +627,7 @@ cc_library(
], ],
}), }),
hdrs = ["minimal_logging.h"], hdrs = ["minimal_logging.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS + tflite_copts(), copts = TFLITE_DEFAULT_COPTS + tflite_copts(),
linkopts = select({ linkopts = select({
"//tensorflow:android": ["-llog"], "//tensorflow:android": ["-llog"],
@ -631,6 +648,7 @@ cc_library(
"type_to_tflitetype.h", "type_to_tflitetype.h",
], ],
}), }),
compatible_with = get_compatible_with_portable(),
deps = ["//tensorflow/lite/c:common"], deps = ["//tensorflow/lite/c:common"],
) )
@ -660,6 +678,7 @@ cc_test(
cc_library( cc_library(
name = "shared_library", name = "shared_library",
hdrs = ["shared_library.h"], hdrs = ["shared_library.h"],
compatible_with = get_compatible_with_portable(),
linkopts = if_not_windows(["-ldl"]), linkopts = if_not_windows(["-ldl"]),
) )

View File

@ -3,6 +3,7 @@ load(
"tflite_cc_shared_object", "tflite_cc_shared_object",
"tflite_copts", "tflite_copts",
) )
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
@ -123,6 +124,7 @@ cc_library(
"builtin_op_data.h", "builtin_op_data.h",
"common.h", "common.h",
], ],
compatible_with = get_compatible_with_portable(),
alwayslink = 1, alwayslink = 1,
) )

View File

@ -1,5 +1,6 @@
load("//tensorflow/lite:build_def.bzl", "tflite_copts") load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts") load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
@ -21,6 +22,7 @@ cc_library(
"profiler.h", "profiler.h",
"tensor_utils.h", "tensor_utils.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + micro_copts(), copts = tflite_copts() + micro_copts(),
deps = [ deps = [
"@flatbuffers//:runtime_cc", "@flatbuffers//:runtime_cc",

View File

@ -14,6 +14,7 @@
# ============================================================================== # ==============================================================================
load("//tensorflow/lite:build_def.bzl", "tflite_copts", "tflite_linkopts") load("//tensorflow/lite:build_def.bzl", "tflite_copts", "tflite_linkopts")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
@ -23,6 +24,7 @@ package(
cc_library( cc_library(
name = "status", name = "status",
hdrs = ["status.h"], hdrs = ["status.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",
@ -33,6 +35,7 @@ cc_library(
name = "utils", name = "utils",
srcs = ["utils.cc"], srcs = ["utils.cc"],
hdrs = ["utils.h"], hdrs = ["utils.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
"//tensorflow/lite:kernel_api", "//tensorflow/lite:kernel_api",

View File

@ -1,4 +1,5 @@
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = [ default_visibility = [
@ -26,6 +27,7 @@ cc_library(
"nnapi_delegate.h", "nnapi_delegate.h",
"nnapi_delegate_kernel.h", "nnapi_delegate_kernel.h",
], ],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
"//tensorflow/lite:allocation", "//tensorflow/lite:allocation",
"//tensorflow/lite:kernel_api", "//tensorflow/lite:kernel_api",

View File

@ -1,4 +1,5 @@
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
@ -38,6 +39,7 @@ cc_library(
cc_library( cc_library(
name = "xnnpack_delegate_hdrs_only", name = "xnnpack_delegate_hdrs_only",
hdrs = ["xnnpack_delegate.h"], hdrs = ["xnnpack_delegate.h"],
compatible_with = get_compatible_with_portable(),
visibility = ["//tensorflow/lite:__subpackages__"], visibility = ["//tensorflow/lite:__subpackages__"],
deps = [ deps = [
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",

View File

@ -1,3 +1,5 @@
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0 licenses = ["notice"], # Apache 2.0
@ -16,6 +18,7 @@ cc_library(
"resource_variable.h", "resource_variable.h",
"static_hashtable.h", "static_hashtable.h",
], ],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
"//tensorflow/lite:string_util", "//tensorflow/lite:string_util",
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",

View File

@ -2,6 +2,7 @@ load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts") load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "tf_opts_nortti_if_android") load("//tensorflow:tensorflow.bzl", "tf_opts_nortti_if_android")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = [ default_visibility = [
@ -429,6 +430,7 @@ cc_library(
hdrs = [ hdrs = [
"op_macros.h", "op_macros.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = ["//tensorflow/lite/micro:debug_log"], deps = ["//tensorflow/lite/micro:debug_log"],
) )
@ -441,6 +443,7 @@ cc_library(
hdrs = [ hdrs = [
"kernel_util.h", "kernel_util.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + micro_copts(), copts = tflite_copts() + micro_copts(),
deps = [ deps = [
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",

View File

@ -3,6 +3,7 @@ load("//tensorflow:tensorflow.bzl", "transitive_hdrs")
load("//tensorflow/lite:build_def.bzl", "tflite_copts") load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts") load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = [ default_visibility = [
@ -47,6 +48,7 @@ NEON_FLAGS_IF_APPLICABLE = select({
cc_library( cc_library(
name = "compatibility", name = "compatibility",
hdrs = ["compatibility.h"], hdrs = ["compatibility.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
"//tensorflow/lite/kernels:op_macros", "//tensorflow/lite/kernels:op_macros",
@ -56,6 +58,7 @@ cc_library(
cc_library( cc_library(
name = "types", name = "types",
hdrs = ["types.h"], hdrs = ["types.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
":compatibility", ":compatibility",
@ -372,6 +375,7 @@ cc_library(
"max.h", "max.h",
"min.h", "min.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
) )
@ -379,6 +383,7 @@ cc_library(
name = "quantization_util", name = "quantization_util",
srcs = ["quantization_util.cc"], srcs = ["quantization_util.cc"],
hdrs = ["quantization_util.h"], hdrs = ["quantization_util.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + micro_copts(), copts = tflite_copts() + micro_copts(),
deps = [ deps = [
":compatibility", ":compatibility",
@ -608,6 +613,7 @@ cc_library(
"tensor.h", "tensor.h",
], ],
}), }),
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
":types", ":types",

View File

@ -1,4 +1,5 @@
load("//tensorflow/lite:special_rules.bzl", "if_nnapi") load("//tensorflow/lite:special_rules.bzl", "if_nnapi")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = [ default_visibility = [
@ -13,6 +14,7 @@ cc_library(
"NeuralNetworksShim.h", "NeuralNetworksShim.h",
"NeuralNetworksTypes.h", "NeuralNetworksTypes.h",
], ],
compatible_with = get_compatible_with_portable(),
linkopts = if_nnapi(["-ldl"]), linkopts = if_nnapi(["-ldl"]),
) )
@ -25,6 +27,7 @@ cc_library(
hdrs = [ hdrs = [
"nnapi_implementation.h", "nnapi_implementation.h",
], ],
compatible_with = get_compatible_with_portable(),
linkopts = if_nnapi(["-ldl"]) + if_nnapi( linkopts = if_nnapi(["-ldl"]) + if_nnapi(
supported = ["-lrt"], supported = ["-lrt"],
supported_android = [], supported_android = [],
@ -38,6 +41,7 @@ cc_library(
name = "nnapi_util", name = "nnapi_util",
srcs = ["nnapi_util.cc"], srcs = ["nnapi_util.cc"],
hdrs = ["nnapi_util.h"], hdrs = ["nnapi_util.h"],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
":nnapi_implementation", ":nnapi_implementation",
"//tensorflow/lite:util", "//tensorflow/lite:util",

View File

@ -1,6 +1,7 @@
load("//tensorflow:tensorflow.bzl", "py_test") load("//tensorflow:tensorflow.bzl", "py_test")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = [ default_visibility = [
@ -64,6 +65,7 @@ exports_files([
flatbuffer_cc_library( flatbuffer_cc_library(
name = "schema_fbs", name = "schema_fbs",
srcs = ["schema.fbs"], srcs = ["schema.fbs"],
compatible_with = get_compatible_with_portable(),
) )
# Generic schema for flatbuffer converter (but with mutable makes bigger). # Generic schema for flatbuffer converter (but with mutable makes bigger).

View File

@ -2577,12 +2577,13 @@ def _local_genrule(**kwargs):
**kwargs **kwargs
) )
def tf_version_info_genrule(name, out): def tf_version_info_genrule(name, out, compatible_with = None):
# TODO(gunan): Investigate making this action hermetic so we do not need # TODO(gunan): Investigate making this action hermetic so we do not need
# to run it locally. # to run it locally.
_local_genrule( _local_genrule(
name = name, name = name,
out = out, out = out,
compatible_with = compatible_with,
exec_tool = "//tensorflow/tools/git:gen_git_source", exec_tool = "//tensorflow/tools/git:gen_git_source",
srcs = [ srcs = [
"@local_config_git//:gen/spec.json", "@local_config_git//:gen/spec.json",
@ -2928,3 +2929,6 @@ def tf_grpc_dependency():
def tf_grpc_cc_dependency(): def tf_grpc_cc_dependency():
return "//tensorflow:grpc++" return "//tensorflow:grpc++"
def get_compatible_with_portable():
return []

View File

@ -24,6 +24,7 @@ def flatbuffer_library_public(
out_prefix = "", out_prefix = "",
includes = [], includes = [],
include_paths = [], include_paths = [],
compatible_with = [],
flatc_args = DEFAULT_FLATC_ARGS, flatc_args = DEFAULT_FLATC_ARGS,
reflection_name = "", reflection_name = "",
reflection_visibility = None, reflection_visibility = None,
@ -43,6 +44,8 @@ def flatbuffer_library_public(
single source targets. Usually is a directory name. single source targets. Usually is a directory name.
includes: Optional, list of filegroups of schemas that the srcs depend on. includes: Optional, list of filegroups of schemas that the srcs depend on.
include_paths: Optional, list of paths the includes files can be found in. include_paths: Optional, list of paths the includes files can be found in.
compatible_with: Optional, passed to genrule for environments this rule
can be built for.
flatc_args: Optional, list of additional arguments to pass to flatc. flatc_args: Optional, list of additional arguments to pass to flatc.
reflection_name: Optional, if set this will generate the flatbuffer reflection_name: Optional, if set this will generate the flatbuffer
reflection binaries for the schemas. reflection binaries for the schemas.
@ -72,6 +75,7 @@ def flatbuffer_library_public(
srcs = srcs, srcs = srcs,
outs = outs, outs = outs,
output_to_bindir = output_to_bindir, output_to_bindir = output_to_bindir,
compatible_with = compatible_with,
tools = includes + [flatc_path], tools = includes + [flatc_path],
cmd = genrule_cmd, cmd = genrule_cmd,
message = "Generating flatbuffer files for %s:" % (name), message = "Generating flatbuffer files for %s:" % (name),
@ -97,6 +101,7 @@ def flatbuffer_library_public(
srcs = srcs, srcs = srcs,
outs = reflection_outs, outs = reflection_outs,
output_to_bindir = output_to_bindir, output_to_bindir = output_to_bindir,
compatible_with = compatible_with,
tools = includes + [flatc_path], tools = includes + [flatc_path],
cmd = reflection_genrule_cmd, cmd = reflection_genrule_cmd,
message = "Generating flatbuffer reflection binary for %s:" % (name), message = "Generating flatbuffer reflection binary for %s:" % (name),
@ -111,6 +116,7 @@ def flatbuffer_library_public(
# native.FilesetEntry(files = reflection_outs), # native.FilesetEntry(files = reflection_outs),
# ], # ],
# visibility = reflection_visibility, # visibility = reflection_visibility,
# compatible_with = compatible_with,
# ) # )
def flatbuffer_cc_library( def flatbuffer_cc_library(
@ -120,6 +126,7 @@ def flatbuffer_cc_library(
out_prefix = "", out_prefix = "",
includes = [], includes = [],
include_paths = [], include_paths = [],
compatible_with = [],
flatc_args = DEFAULT_FLATC_ARGS, flatc_args = DEFAULT_FLATC_ARGS,
visibility = None, visibility = None,
srcs_filegroup_visibility = None, srcs_filegroup_visibility = None,
@ -175,6 +182,8 @@ def flatbuffer_cc_library(
includes: Optional, list of filegroups of schemas that the srcs depend on. includes: Optional, list of filegroups of schemas that the srcs depend on.
** SEE REMARKS BELOW ** ** SEE REMARKS BELOW **
include_paths: Optional, list of paths the includes files can be found in. include_paths: Optional, list of paths the includes files can be found in.
compatible_with: Optional, passed to genrule for environments this rule
can be built for
flatc_args: Optional list of additional arguments to pass to flatc flatc_args: Optional list of additional arguments to pass to flatc
(e.g. --gen-mutable). (e.g. --gen-mutable).
visibility: The visibility of the generated cc_library. By default, use the visibility: The visibility of the generated cc_library. By default, use the
@ -198,6 +207,7 @@ def flatbuffer_cc_library(
out_prefix = out_prefix, out_prefix = out_prefix,
includes = includes, includes = includes,
include_paths = include_paths, include_paths = include_paths,
compatible_with = compatible_with,
flatc_args = flatc_args, flatc_args = flatc_args,
reflection_name = reflection_name, reflection_name = reflection_name,
reflection_visibility = visibility, reflection_visibility = visibility,
@ -215,6 +225,7 @@ def flatbuffer_cc_library(
includes = ["."], includes = ["."],
linkstatic = 1, linkstatic = 1,
visibility = visibility, visibility = visibility,
compatible_with = compatible_with,
) )
# A filegroup for the `srcs`. That is, all the schema files for this # A filegroup for the `srcs`. That is, all the schema files for this
@ -223,6 +234,7 @@ def flatbuffer_cc_library(
name = srcs_filegroup_name if srcs_filegroup_name else "%s_includes" % (name), name = srcs_filegroup_name if srcs_filegroup_name else "%s_includes" % (name),
srcs = srcs, srcs = srcs,
visibility = srcs_filegroup_visibility if srcs_filegroup_visibility != None else visibility, visibility = srcs_filegroup_visibility if srcs_filegroup_visibility != None else visibility,
compatible_with = compatible_with,
) )
# Custom provider to track dependencies transitively. # Custom provider to track dependencies transitively.