bazel
bazel copied to clipboard
Unable to include *.ipp files in cc_library
Is there a way to include *.ipp files in a cc_library? Some open source libraries use these.
Sample bazel build output:
$ bazel build examples/cpp:hello-lib
ERROR: /Users/trevorgray/code/src/github.com/google/bazel/examples/cpp/BUILD:6:12: in hdrs attribute of cc_library rule //examples/cpp:hello-lib: file '//examples/cpp:hello-lib.ipp' is misplaced here (expected .h, .hh, .hpp, .hxx or .inc).
ERROR: /Users/trevorgray/code/src/github.com/google/bazel/examples/cpp/BUILD:6:12: in hdrs attribute of cc_library rule //examples/cpp:hello-lib: '//examples/cpp:hello-lib.ipp' does not produce any cc_library hdrs files (expected .h, .hh, .hpp, .hxx or .inc).
ERROR: Analysis of target '//examples/cpp:hello-lib' failed; build aborted.
INFO: Elapsed time: 0.683s
Sample build rule:
cc_library(
name = "hello-lib",
srcs = ["hello-lib.cc"],
hdrs = [
"hello-lib.h",
"hello-lib.ipp",
],
)
Sounds like https://github.com/google/bazel/issues/164. See https://groups.google.com/d/msg/bazel-discuss/_vtnJjSFSVY/piCVteEe1owJ for a workaround.
Closing as duplicate