mediapipe/mediapipe/framework/api2/BUILD
MediaPipe Team 66655a15b2 API 2: Do not redirect from MEDIAPIPE_REGISTER_NODE to REGISTER_CALCULATOR
The problem with redirecting is that the calling code has to include API 1 code (often third_party/mediapipe/framework/calculator_framework.h), even though they are only using API 2 functionality (albeit deprecated). This can lead to weird issues, e.g. MakePacket<T> confusingly does not return a Packet<T>, but a Packet, because it's using the API 1 version.

PiperOrigin-RevId: 588798455
2023-12-07 08:20:28 -08:00

228 lines
5.1 KiB
Python

# Placeholder: load py_test
package(
default_visibility = ["//visibility:public"],
features = ["-use_header_modules"],
)
licenses(["notice"])
cc_library(
name = "const_str",
hdrs = ["const_str.h"],
)
cc_library(
name = "builder",
hdrs = ["builder.h"],
deps = [
":port",
"//mediapipe/framework:calculator_base",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework/port:any_proto",
"//mediapipe/framework/port:ret_check",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/strings",
"@com_google_protobuf//:protobuf",
],
)
cc_test(
name = "builder_test",
srcs = ["builder_test.cc"],
deps = [
":builder",
":node",
":packet",
":port",
":tag",
":test_contracts",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:parse_text_proto",
"//mediapipe/framework/testdata:night_light_calculator_cc_proto",
"//mediapipe/framework/testdata:sky_light_calculator_cc_proto",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "contract",
hdrs = ["contract.h"],
deps = [
":const_str",
":packet",
":port",
":tag",
":tuple",
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:output_side_packet",
"//mediapipe/framework/port:logging",
],
)
cc_test(
name = "contract_test",
srcs = ["contract_test.cc"],
deps = [
":contract",
":port",
":tag",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:parse_text_proto",
],
)
cc_library(
name = "node",
srcs = ["node.cc"],
hdrs = ["node.h"],
deps = [
":contract",
"//mediapipe/framework:calculator_base",
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:subgraph",
"//mediapipe/framework/deps:registration",
"@com_google_absl//absl/status",
],
)
cc_library(
name = "test_contracts",
testonly = 1,
hdrs = ["test_contracts.h"],
deps = [
":node",
],
)
cc_test(
name = "node_test",
srcs = ["node_test.cc"],
deps = [
":node",
":packet",
":port",
":test_contracts",
":tuple",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:parse_text_proto",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/log:absl_log",
],
)
cc_library(
name = "packet",
srcs = ["packet.cc"],
hdrs = ["packet.h"],
deps = [
":tuple",
"//mediapipe/framework:packet",
"//mediapipe/framework/port:logging",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/meta:type_traits",
],
)
cc_test(
name = "packet_test",
size = "small",
srcs = [
"packet_test.cc",
],
deps = [
":packet",
"//mediapipe/framework/port:gtest_main",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "port",
hdrs = ["port.h"],
deps = [
":const_str",
":packet",
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:output_side_packet",
"//mediapipe/framework/port:logging",
"//mediapipe/framework/tool:type_util",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/strings",
],
)
cc_test(
name = "port_test",
size = "small",
srcs = [
"port_test.cc",
],
deps = [
":port",
"//mediapipe/framework/port:gtest_main",
"@com_google_absl//absl/strings",
],
)
cc_test(
name = "subgraph_test",
srcs = ["subgraph_test.cc"],
deps = [
":builder",
":node",
":packet",
":port",
":test_contracts",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:parse_text_proto",
"//mediapipe/framework/tool:subgraph_expansion",
],
)
cc_library(
name = "tag",
hdrs = ["tag.h"],
deps = [":const_str"],
)
cc_test(
name = "tag_test",
size = "small",
srcs = [
"tag_test.cc",
],
deps = [
":tag",
"//mediapipe/framework/port:gtest_main",
],
)
cc_library(
name = "tuple",
hdrs = ["tuple.h"],
deps = ["@com_google_absl//absl/meta:type_traits"],
)
cc_test(
name = "tuple_test",
size = "small",
srcs = [
"tuple_test.cc",
],
deps = [
":tuple",
"//mediapipe/framework/port:gtest_main",
"@com_google_absl//absl/strings",
],
)