• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//tensorflow_lite_support/metadata:build_defs.bzl", "stamp_metadata_parser_version")
2
3package(
4    default_visibility = ["//tensorflow_lite_support:users"],
5    licenses = ["notice"],  # Apache 2.0
6)
7
8stamp_metadata_parser_version(
9    name = "metadata_parser_h",
10    srcs = ["metadata_parser.h.template"],
11    outs = ["metadata_parser.h"],
12)
13
14cc_library(
15    name = "metadata_extractor",
16    srcs = ["metadata_extractor.cc"],
17    hdrs = ["metadata_extractor.h"],
18    deps = [
19        "@com_google_absl//absl/container:flat_hash_map",
20        "@com_google_absl//absl/memory",
21        "@com_google_absl//absl/status",
22        "@com_google_absl//absl/strings",
23        "@com_google_absl//absl/strings:str_format",
24        "@flatbuffers",
25        "@org_libzip//:zip",
26    ] + select({
27        "//tensorflow_lite_support/cc:tflite_use_c_api": ["@org_tensorflow//tensorflow/lite/c:c_api"],
28        "//conditions:default": ["@org_tensorflow//tensorflow/lite:framework"],
29    }) + [
30        "@org_tensorflow//tensorflow/lite/schema:schema_fbs",
31        "//tensorflow_lite_support/cc:common",
32        "//tensorflow_lite_support/cc/port:status_macros",
33        "//tensorflow_lite_support/cc/port:statusor",
34        "//tensorflow_lite_support/metadata:metadata_schema_cc",
35    ],
36)
37
38cc_library(
39    name = "metadata_version",
40    srcs = ["metadata_version.cc"],
41    hdrs = [
42        "metadata_version.h",
43        ":metadata_parser_h",
44    ],
45    deps = [
46        "//tensorflow_lite_support/metadata:metadata_schema_cc",
47        "@com_google_absl//absl/strings",
48        "@flatbuffers",
49        "@org_tensorflow//tensorflow/lite/c:common",
50        "@org_tensorflow//tensorflow/lite/kernels/internal:compatibility",
51        "@org_tensorflow//tensorflow/lite/tools:logging",
52    ],
53)
54