Let’s say my WORKSPACE file in the root directory of my project looks like this:
workspace(name = "some_workspace")
load(@bazel_tools//tools/build_defs/repo:local.bzl)
new_local_repository(
name = "some_repo"
build_file = "//bazel/third_party:some_repo.BUILD",
path = "C:/some_repo",
)
And bazel/third_party/some_repo.BUILD looks like this:
cc_library(
name = "some_library",
srcs = glob(["src/**/*.cpp"]),
visibility = ["//visibility:public"],
)
Questions (all questions pertain to code written in some_repo.BUILD):
-
Since I used the build_file parameter, all paths defined in some_repo.BUILD are relative to the directory of the my_repo repository, so I can just write
"src/**/*.cpp"
instead of@my_repo/src/**/*.cpp
, correct? -
Would
"//src/**/*.cpp"
point to the root directory of my project or to the root directory of my_repo? If the latter, how can I access the root directory of my project? With"@some_workspace//"
? -
Does the double slash in
"//visibility:public"
point to root directory of my project or to the root directory of my_repo? If the latter, is this target then only visible to packages inside my_repo? How can I set the target visible to all packages inside my project?