Closed skeptic-monkey closed 1 year ago
You'll need to make them srcs
of the pkg_tar
target. But you probably want to use pkg_files
to map them into the location you want your users to include from. Perhaps something like /usr/include/my_pkg/...
. Or maybe you want them flattened into the same directory as your binary.
Gathering the transitive headers is possible, but not something we should do in this rule set. You might want to ask the rules_cc community. My thought would be you would create a rule that expects CcInfo
on its inputs, which would be youre cc_library
target. Then you would peek into CcInfo
and get the headers bazel would use for compilation. Then from that list, create a PackageFilesInfo
mapping the input headers to reasonable locations. But... that's just my off the cuff suggestion.
What you're proposing is excactly what I was doing, but before going too far in my rule development I wanted to make sure that I wasn't reinventing the wheel.
Thanks.
Hi,
I'd like to release some of my cc_library as prebuilt libraries (using .tar or .zip file)
right now, when using pkg_tar on a cc_library, the .tar file only contains the .a / .so files. Is it possible to also have all the public headers required to build against the library as well ?