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

Linking bindgen-generated libraries against other bindgen-generated libraries #1307

Closed
asajeffrey opened this issue May 3, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@asajeffrey
Copy link

commented May 3, 2018

If there are two libraries a.h:

struct Foo { ... }

and b.h:

#include "a.h"
Foo bar() { ... }

and both of these have sys crates generated by bindgen, there should be a way to get b_sys to use the Foo from a_sys. We can almost do this by putting the following into the build.rs of b_sys:

   builder.raw_line("use a_sys::*");

but this produces:

use a_sys::*;
pub mod root {
   ...
   fn bar() -> root::Foo { ... }
}

That is the raw_line is outside the root crate, not inside it. If we could put raw lines inside the root, this would be pretty easy.

@asajeffrey

This comment has been minimized.

Copy link
Author

commented May 3, 2018

@emilio emilio self-assigned this May 3, 2018

bors-servo added a commit that referenced this issue May 3, 2018

Auto merge of #1308 - emilio:per-module-lines, r=fitzgen
Add an option to add lines per module.

Fixes #1307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.