Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Generate ctru-sys as part of the build system #47

Open
linkmauve opened this issue Dec 16, 2017 · 6 comments
Open

Generate ctru-sys as part of the build system #47

linkmauve opened this issue Dec 16, 2017 · 6 comments

Comments

@linkmauve
Copy link

Have a look at rust-bindgen, it can create -sys crates automatically from headers, which will alleviate a good part of your work.

@linkmauve
Copy link
Author

Actually, I didn’t see it was already generated, my request then is to make it automated as part of the build system, or at least documenting how to update it.

@linkmauve linkmauve changed the title Generate ctru-sys automatically Generate ctru-sys as part of the build system Dec 16, 2017
@panicbit
Copy link
Member

IIRC we opted for generating them only when needed to stay in sync with a specific libctru release.

I have a script for citro3d-sys to generate bindings, which I will probably port over for libctru-sys. It might even make sense to use some sort of Rust task runner like cargo-make or even just cargo-script instead (to get away from platform dependant scripts).

@linkmauve
Copy link
Author

It was exactly for citro3d that I wanted to use this. :)
I’ll wait for your release then, thanks!

@panicbit
Copy link
Member

panicbit commented Dec 16, 2017

citro3d is a bit of a pain to port to safe Rust, but I intended to at least release a sys crate

@panicbit
Copy link
Member

Here you go: https://github.com/rust3ds/citro3d-sys

I didn't manage to verify that the crate still builds properly because ctru-rs doesn't build for me right now and I have no time to figure out why.

@FenrirWolf
Copy link
Member

FenrirWolf commented Dec 16, 2017

For the record, this is the build script I used to generate ctru-sys locally last time I updated it: https://github.com/FenrirWolf/ctru-rs/blob/bindgen/ctru-sys/build.rs

We definitely could generate the bindings at build-time by default instead of checking them in manually, but the trade-off there is that running bindgen increases compile times and adds a dependency on clang.

SeleDreams pushed a commit to SeleDreams/ctru-rs that referenced this issue Jul 20, 2022
…ad-file-contents

Add support for reading files to file-explorer
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants