Skip to content

Commit 793a74f

Browse files
author
bors-servo
authored
Auto merge of rust-lang#419 - fitzgen:cargo-metadata, r=emilio
Small cargo and docs clean ups r? @emilio
2 parents d593dff + 28a3784 commit 793a74f

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,12 @@ issue, provide us with:
4242

4343
## Building
4444

45-
To build `bindgen`:
45+
To build the `bindgen` library and the `bindgen` executable:
4646

4747
```
4848
$ cargo build
4949
```
5050

51-
To build the `bindgen` executable:
52-
53-
```
54-
$ cd bindgen/bindgen
55-
$ cargo build
56-
```
57-
5851
If you installed multiple versions of llvm, it may not be able to locate the
5952
latest version of libclang. In that case, you may want to either uninstall other
6053
versions of llvm, or specify the path of the desired libclang explicitly:

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
authors = [
33
"Jyun-Yan You <[email protected]>",
44
"Emilio Cobos Álvarez <[email protected]>",
5+
"Nick Fitzgerald <[email protected]>",
56
"The Servo project developers",
67
]
7-
description = "A binding generator for Rust"
8+
description = "Automatically generates Rust FFI bindings to C and C++ libraries."
89
keywords = ["bindings", "ffi", "code-generation"]
9-
categories = ["external-ffi-bindings"]
10+
categories = ["external-ffi-bindings", "development-tools::ffi"]
1011
license = "BSD-3-Clause"
1112
name = "bindgen"
1213
readme = "README.md"

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Those instructions list optional steps. For bindgen:
8787

8888
### Library usage with `build.rs`
8989

90+
💡 This is the recommended way to use `bindgen`. 💡
91+
9092
#### `build.rs` Tutorial
9193

9294
[Here is a step-by-step tutorial for generating FFI bindings to the `bzip2` C library.][tutorial]
@@ -153,11 +155,23 @@ There are a few options documented when running `./bindgen --help`.
153155

154156
### C++
155157

156-
This fork of rust-bindgen can handle a number of C++ features.
158+
`bindgen` can handle most C++ features, but not all of them (C++ is hard!)
159+
160+
Notable C++ features that are unsupported or only partially supported:
161+
162+
* Partial template specialization
163+
* Traits templates
164+
* SFINAE
165+
* Instantiating new template specializations
157166

158167
When passing in header files, the file will automatically be treated as C++ if
159168
it ends in ``.hpp``. If it doesn't, ``-x c++`` can be used to force C++ mode.
160169

170+
You must use whitelisting when working with C++ to avoid pulling in all of the
171+
`std::*` types, some of which `bindgen` cannot handle. Additionally, you may
172+
want to blacklist other types that `bindgen` stumbles on, or make `bindgen`
173+
treat certain types as opaque.
174+
161175
### Annotations
162176

163177
The translation of classes, structs, enums, and typedefs can be adjusted using

0 commit comments

Comments
 (0)