| """.bzl file for TFLite Support open source build configs.""" |
| |
| load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") |
| |
| def provided_args(**kwargs): |
| """Returns the keyword arguments omitting None arguments.""" |
| return {k: v for k, v in kwargs.items() if v != None} |
| |
| def support_cc_proto_library(name, srcs, visibility = None, deps = [], cc_deps = [], testonly = 0): |
| """Generate cc_proto_library for TFLite Support open source version. |
| |
| Args: |
| name: the name of the cc_proto_library. |
| srcs: the .proto files of the cc_proto_library for Bazel use. |
| visibility: visibility of this target. |
| deps: a list of dependency labels for Bazel use; must be cc_proto_library. |
| testonly: test only proto or not. |
| """ |
| _ignore = [deps] |
| cc_proto_library(**provided_args( |
| name = name, |
| srcs = srcs, |
| visibility = visibility, |
| deps = cc_deps, |
| testonly = testonly, |
| cc_libs = ["@com_google_protobuf//:protobuf"], |
| protoc = "@com_google_protobuf//:protoc", |
| default_runtime = "@com_google_protobuf//:protobuf", |
| alwayslink = 1, |
| )) |