My project as the following structure:
$ tree
.
├── bar
│ ├── bar.cpp
│ └── BUILD
├── BUILD
├── foo.cpp
└── WORKSPACE
Content of ./BUILD
:
cc_binary(
name = "foo",
srcs = [ "foo.cpp" ],
deps = [ "//bar" ],
)
Content of bar/BUILD
:
cc_library(
name = "bar",
srcs = ["bar.cpp"],
)
If I build foo
, I get the following error:
Target '//bar:bar' is not visible from target '//:foo'. Check the visibility declaration of the former target if you think the dependency is legitimate.
What do I need to do so the dependency can be resolved and foo
is built successfully?