-
Notifications
You must be signed in to change notification settings - Fork 42
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
Generating headers for other platforms – Support for #[cfg(target…)]
-dependent signatures
#73
Comments
As an aside, I've been using |
Thanks, very glad to hear that 😊 Regarding the OP:
Yeah, sadly supporting that one is surprisingly hard: the whole idea of This means that, technically, I have been unable to feature any place to "collect and emit" the header code other than a unit test (alas, not even an integration or an example binary work!). I've been been kind of at peace with that thanks to the emitted C code using the type aliases to be as platform agnostic as possible (e.g., I am, in parallel, learning about compiler lints and other stuff, so that I may be able to, eventually, go and try the compiler plugin approach, but that won't be achieved within the current year. In the interim, I suggest the following workaround:
|
#[cfg(target…)]
-dependent signatures
Hmm, what did you try? I remember experimenting with I distinctly remember wondering why my "runner" executable wasn't able to detect any questions and figured out you need to make sure Rust links in any crates containing The way I've done this in the past is to do either an explicit
Wait, there is hope! When troubleshooting an unrelated cross-compilation issue (TensorFlow's build system is... less than ideal) I started using One of the nice things about My PR's CI is currently failing because of TensorFlow, but this was my solution. |
Interesting leads; I'll investigate them soon and see what it gives (if they work, I'll add them to the documentation / future FAQ, so as to consider this as "solved", hence my removing the |
Is there a way to generate header files for bindings which get cross-compiled? Currently, headers are generated by running a test on the host machine, but that assumes your test suite is executable.
I could bodge things together using a virtualisation layer like
qemu
and having the VM print the generated header to stdout, but that isn't ideal.My use case is:
The text was updated successfully, but these errors were encountered: