Aniket Vishwakarma
Aniket Vishwakarma

Reputation: 99

This Bazel build file has only deps no srcs

I was trying to use google's media pipe but this Bazel build has no srcs only deps. What is supposed to be the main program in this build?

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",
    ],
)

Upvotes: 0

Views: 643

Answers (1)

Michal Partyka
Michal Partyka

Reputation: 49

As stated in cc_binary docs deps defines list of libraries linked to this binary target. First dependency of each rule defines a library with the main function. You can see this looking at first dependency definition:

mediapipe/examples/desktop/BUILD:

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

Therefore main is defined in mediapipe/examples/desktop/demo_run_graph_main.cc

Hope it helps ;)

Upvotes: 1

Related Questions