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

BINDGEN_EXTRA_CLANG_ARGS for command line mode #1723

Closed
BaoshanPang opened this issue Feb 6, 2020 · 5 comments
Closed

BINDGEN_EXTRA_CLANG_ARGS for command line mode #1723

BaoshanPang opened this issue Feb 6, 2020 · 5 comments

Comments

@BaoshanPang
Copy link

BaoshanPang commented Feb 6, 2020

when option dump-preprocessed-input is used, BINDGEN_EXTRA_CLANG_ARGS is evaluated AFTER handling dump-preprocessed-input which result errors like "head files not found" etc in cross-compiling.

@emilio
Copy link
Contributor

emilio commented Feb 11, 2020

Ah, this should be relatively straight-forward to fix. Probably most of Bindings::generate should move to a common function that dump_preprocessed_input could reuse. We should make sure we only run it once though.

@highfive
Copy link

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@smurfd
Copy link
Contributor

smurfd commented Jul 31, 2020

Hi, have looked at this abit and was wondering.

Would it be something like in impl Bindings { create a

fn generate_common(options: &mut BindgenOptions) {
// context from these lines : 
https://github.com/rust-lang/rust-bindgen/blob/b424c17608206166b98db0e1b7da752a1e560f54/src/lib.rs#L1884-L1956
}

then at :


we call Bindings::generate_common(&mut options);

Im abit fuzzy on where in dump_preprocessed_input we would call this generate_common()
Maby here?


Before we go through the self.options.clang_args that the BINDGEN_EXTRA_CLANG_ARGS is stored?!

And then for it to just be run once we have a boolean argument to Bindings::generate that is set to false as default, but if true then we dont run the generate_common()

Pretty much here, set a boolean to true


that we add to the Bindings::generate(self.option) abit lower down.

Thanks in advance :)

@smurfd
Copy link
Contributor

smurfd commented Jul 19, 2021

Hey, if someone is interested in working on this, please please do.
Had completely forgot about this until last week when i got a mail about my pr conflicting with 67538b6

Will probably close my pr in a while if i don't see something easy i have missed.

@smurfd
Copy link
Contributor

smurfd commented Aug 4, 2021

nevermind the above, have an actual patch that might be what is looked for in #1915

emilio pushed a commit to smurfd/rust-bindgen that referenced this issue Feb 18, 2022
emilio pushed a commit to smurfd/rust-bindgen that referenced this issue Feb 18, 2022
@emilio emilio closed this as completed in f34e410 Feb 18, 2022
aatifsyed pushed a commit to aatifsyed/rust-bindgen that referenced this issue Sep 22, 2022
LoganBarnett pushed a commit to LoganBarnett/rust-bindgen that referenced this issue Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants