diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-01-23 11:04:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-23 11:04:52 -0800 |
commit | 793a74f6c0a3369e8011502b6324396b6b4d021c (patch) | |
tree | 7c63e735a4d802e997a89765acb9fb3e2e1a1db6 | |
parent | d593dff1e914b7ceb62aa1b0480d9828bbb24b38 (diff) | |
parent | 28a3784b778e5d10ce492d8434aa7b489615452d (diff) |
Auto merge of #419 - fitzgen:cargo-metadata, r=emilio
Small cargo and docs clean ups
r? @emilio
-rw-r--r-- | CONTRIBUTING.md | 9 | ||||
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | README.md | 16 |
3 files changed, 19 insertions, 11 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d30df68d..cfcee653 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,19 +42,12 @@ issue, provide us with: ## Building -To build `bindgen`: +To build the `bindgen` library and the `bindgen` executable: ``` $ cargo build ``` -To build the `bindgen` executable: - -``` -$ cd bindgen/bindgen -$ cargo build -``` - If you installed multiple versions of llvm, it may not be able to locate the latest version of libclang. In that case, you may want to either uninstall other versions of llvm, or specify the path of the desired libclang explicitly: @@ -2,11 +2,12 @@ authors = [ "Jyun-Yan You <jyyou.tw@gmail.com>", "Emilio Cobos Álvarez <emilio@crisal.io>", + "Nick Fitzgerald <fitzgen@gmail.com>", "The Servo project developers", ] -description = "A binding generator for Rust" +description = "Automatically generates Rust FFI bindings to C and C++ libraries." keywords = ["bindings", "ffi", "code-generation"] -categories = ["external-ffi-bindings"] +categories = ["external-ffi-bindings", "development-tools::ffi"] license = "BSD-3-Clause" name = "bindgen" readme = "README.md" @@ -87,6 +87,8 @@ Those instructions list optional steps. For bindgen: ### Library usage with `build.rs` +💡 This is the recommended way to use `bindgen`. 💡 + #### `build.rs` Tutorial [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`. ### C++ -This fork of rust-bindgen can handle a number of C++ features. +`bindgen` can handle most C++ features, but not all of them (C++ is hard!) + +Notable C++ features that are unsupported or only partially supported: + +* Partial template specialization +* Traits templates +* SFINAE +* Instantiating new template specializations When passing in header files, the file will automatically be treated as C++ if it ends in ``.hpp``. If it doesn't, ``-x c++`` can be used to force C++ mode. +You must use whitelisting when working with C++ to avoid pulling in all of the +`std::*` types, some of which `bindgen` cannot handle. Additionally, you may +want to blacklist other types that `bindgen` stumbles on, or make `bindgen` +treat certain types as opaque. + ### Annotations The translation of classes, structs, enums, and typedefs can be adjusted using |