[workspace]/
WORKSPACE
include/
build.h
a/
BUILD
a.h
a.cc
b/
BUILD
b.h
b.cc
main.cc
When I add "#include "include/build.h"" to any .h or .cc source file, I get an error saying build.h cannot be found.
I thought includes were relative to the workspace and figured this would work.
I'd like to avoid adding a include/BUILD with a cc_library() for just these header files, and then adding it to the 'deps' of every other target.
Is there a simpler way?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/99b30903-82b9-4bca-84f2-12afff2f0fef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What Austin said is correct. You cannot directly include include/build.h because build.h is in a different package (//include). You would need to add a include/BUILD and add a cc_library target that //a and //b can depend on in order to use build.h.
David
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CABsbf%3DGuTodOLipkgqqU0kmPoxXMEVhv132WepHdfh-iqEAMtQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/3428fb34-7780-4adb-bb42-5aa632ece66c%40googlegroups.com.
ERROR: /BUILD:10:12: in srcs attribute of cc_library rule //oc/common:upnputil: '//cc:sonos_stdint' does not produce any cc_library srcs files (expected .cc, .cpp, .cxx, .c++, .C, .c, .h, .hh, .hpp, .hxx, .inc, .S, .s, .asm, .a, .pic.a, .lo, .pic.lo, .so, .dylib, .o or .pic.o).
cc_library(
name = "stdint",
visibility = ["//visibility:public"],
hdrs = [
"include/stdint.h",
],
)