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
Assignees

Comments

@asajeffrey
Copy link

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
Copy link
Author

IRC conversation with @emilio: https://mozilla.logbot.info/servo/20180503#c14702783

@emilio emilio self-assigned this May 3, 2018
bors-servo pushed a commit that referenced this issue May 3, 2018
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants