6 Commits

Author SHA1 Message Date
Ian Hobson
6165bbf021 Avoid 'duplicate package' warnings when depending on cbindgen via git
When specifying `cbindgen` as a dependency via git, several 'skipping duplicate
package' warnings pop up regarding some of the test crates.

The warning seems to be spurious given that the test packages aren't needed when
depending on `cbindgen` (see https://github.com/rust-lang/cargo/issues/10752),
but while a fix is being considered for Cargo, this commit disambiguates the
duplicated package names by referring to their relative paths.
2023-05-31 12:31:39 +02:00
Emilio Cobos Álvarez
5f8e027290
rename to extra_bindings per IRC discussion. 2019-06-25 21:33:19 +02:00
Emilio Cobos Álvarez
16b2a25442
Turn the option into a whitelist rather than an on / off switch. 2019-06-25 21:28:12 +02:00
Emilio Cobos Álvarez
0bcd54f9c3
Add an option to generate consts / globals / fn from parsed dependencies.
This is a limitation that may not be useful if you're using it to parse known
dependencies.
2019-06-25 21:28:11 +02:00
Emilio Cobos Álvarez
80da1f59aa Allow to generate associated constants in the body of C++ structs.
Opt-in since it uses a C++17 feature, but this allow exactly the same usage in
C++ and Rust, which I think is nice.

This also fixes constants of transparent structs in general, since the initial
version of this patch broke a test (associated constants in enums), so I added a
test for that too.
2019-02-23 17:58:22 -08:00
Basile Clement
ba589a868e Use Cargo.lock from workspace root
cbindgen currently assumes that the `Cargo.lock` is in directly in the
crate directory as a sibling to `Cargo.toml`; however that is usually
not the case inside a workspace.

Instead, this PR extracts the workspace root from the output of `cargo
metadata` [1] (already used to get a list of packages) and uses the
`Cargo.lock` from there.

 1. This is available since Rust 1.24; see 
2018-07-30 22:02:56 -05:00