Sean1708 / rusty-cheddar

A Rust crate for automatically generating C header files from Rust source file.
http://sean1708.github.io/rusty-cheddar/
191 stars 25 forks source link

Include license notice in generated headers #54

Open afonso360 opened 7 years ago

afonso360 commented 7 years ago

Hi, some licenses such as the GPLv2 require a notice in the headers produced, this is just a simple operation of prepending a comment to the generated headers, would you please be able to add this feature to your library?

This is more of a convinience feature as I can just as well open each header file and prepend the license text myself. (Which is what im currently doing)

If this is more appropriate for the rusty-binder crate tell me and ill open an issue there.

kinetiknz commented 7 years ago

You can use Cheddar::insert_code to insert the license text, for example see https://github.com/mozilla/mp4parse-rust/blob/master/mp4parse_capi/build.rs. The only (slight) down side is that it's inserted after the two C99 headers.