On Wed, Feb 22, 2017, at 07:11 AM, Henri Sivonen wrote:
> Looking at mp4parse, the C header is generated:
> https://searchfox.org/mozilla-central/source/media/libstagefright/binding/mp4parse_capi/build.rs
> But also checked in:
> https://searchfox.org/mozilla-central/source/media/libstagefright/binding/include/mp4parse.h
> 
> Is this the best current practice that I should follow with encoding_rs?
> 
> See also:
> https://users.rust-lang.org/t/how-to-retrieve-h-files-from-dependencies-into-top-level-crates-target/9488
> (unanswered at the moment)

I don't think we have a best practice for this currently. We hit the
opposite issue with bindgen, and I've been informed that we need to run
bindgen at build time because the bindings are ABI-specific. Given that
the C API here is under your complete control, it seems like it's
possible to generate a cross-platform header that doesn't have those
issues, so you could certainly check it in. The only question there is
how much hassle it will be for you to maintain a checked-in copy.

Alternately you could just generate it at build time, and we could pass
the path to $(DIST)/include in a special environment variable so you
could put the header in the right place.

-Ted
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to