Disclaimer: This project is experimental, under heavy development, and should not be used yet.
Most rustc cmdline parameters should be supported (e.g. --crate-type).
Example:
# Set CARGO_TARGET_DIR to avoid generating build artifacts inside of the source
# tree (i.e. generate them elsewhere - where `hg status` cannot see them).
$ export CARGO_TARGET_DIR=$HOME/scratch/cargo-target
$ cat $HOME/scratch/test.rs
pub fn public_function() {
private_function()
}
fn private_function() {}
$ cargo run -- \
--h_out=$HOME/scratch/test.h -- \
$HOME/scratch/test.rs --crate-type=lib --sysroot `rustc --print sysroot`
$ cat $HOME/scratch/test.h
// Automatically @generated C++ bindings for the following Rust crate:
// test
// List of public functions:
// public_function