bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Unable to include *.ipp files in cc_library

Open trevorgray opened this issue 11 years ago • 2 comments

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

trevorgray avatar Apr 27 '15 19:04 trevorgray

Sounds like https://github.com/google/bazel/issues/164. See https://groups.google.com/d/msg/bazel-discuss/_vtnJjSFSVY/piCVteEe1owJ for a workaround.

kchodorow avatar Apr 27 '15 22:04 kchodorow

Closing as duplicate

damienmg avatar May 04 '15 09:05 damienmg