0

我试图使用谷歌的媒体管道,但这个 Bazel 版本没有 srcs only deps。这个构建中的主程序应该是什么?

package(default_visibility = ["//mediapipe/examples:__subpackages__"])

cc_binary(
    name = "hand_tracking_tflite",
    deps = [
        "//mediapipe/examples/desktop:simple_run_graph_main",
        "//mediapipe/graphs/hand_tracking:desktop_tflite_calculators",
    ],
)

cc_binary(
    name = "hand_tracking_cpu",
    deps = [
        "//mediapipe/examples/desktop:demo_run_graph_main",
        "//mediapipe/graphs/hand_tracking:desktop_tflite_calculators",
    ],
)

# Linux only
cc_binary(
    name = "hand_tracking_gpu",
    deps = [
        "//mediapipe/examples/desktop:demo_run_graph_main_gpu",
        "//mediapipe/graphs/hand_tracking:mobile_calculators",
    ],
)
4

1 回答 1

1

cc_binary 文档中所述, deps 定义了链接到此二进制目标的库列表。每个规则的第一个依赖项定义了一个带有 main 函数的库。您可以在查看第一个依赖项定义时看到这一点:

mediapipe/examples/desktop/BUILD:

cc_library(
    name = "simple_run_graph_main",
    srcs = ["simple_run_graph_main.cc"],
    deps = [
#... removed for clarity.
    ],
)

因此 main 定义在mediapipe/examples/desktop/demo_run_graph_main.cc

希望能帮助到你 ;)

于 2020-06-30T08:53:04.733 回答