Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for extracting/bundling headers in C/C++ #5192

Closed
przydatek opened this issue May 11, 2018 · 4 comments
Closed

Support for extracting/bundling headers in C/C++ #5192

przydatek opened this issue May 11, 2018 · 4 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: feature request

Comments

@przydatek
Copy link

Description of the problem / feature request:

Getting C/C++ header files for a library built via Bazel.

Feature requests: what underlying problem are you trying to solve with this feature?

When building C/C++ library to be used in a project without Bazel one needs also a set of the header files with the API that the library offers. It would be nice if Bazel could add some support for creation of a bundle of the relevant headers, e.g. as a filegroup.

What operating system are you running Bazel on?

Linux

What's the output of bazel info release?

release 0.13.0

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

https://github.com/google/tink
eb6673aff24a09947450d8922702f5f43fa9aaa2
eb6673aff24a09947450d8922702f5f43fa9aaa2

Have you found anything relevant by searching the web?

It seems the only way to do it now is "manually", see e.g. TensorFlow: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/lib_package/BUILD#L57
and tensorflow/tensorflow#3536

@hlopko hlopko added type: feature request P2 We'll consider working on this in future. (Assignee optional) labels May 14, 2018
@hlopko
Copy link
Member

hlopko commented May 14, 2018

This will be easily solved in Skylark when #4570 is implemented, I propose to wait until that happens.

@kingstarcraft
Copy link

kingstarcraft commented Feb 21, 2019

If you build tensorflow with bazel on windows, you can try my tool to export the header. I have test my tool can work with tensorflow v1.12.0.

@oquenchil
Copy link
Contributor

You can use the CcInfo provider for this:
https://docs.bazel.build/versions/master/skylark/lib/CcInfo.html

@gccunha1
Copy link

You can use the CcInfo provider for this: https://docs.bazel.build/versions/master/skylark/lib/CcInfo.html

Can someone provide a simple example on how to do this? I've been looking at the documentation and only found this example: https://github.com/bazelbuild/rules_cc/blob/main/examples/my_c_archive/my_c_archive.bzl

For me it's a bit hard to follow as I haven't really been using bazel at its full capacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants