Skip to content

Commit

Permalink
Auto merge of #1760 - jdub:cc-to-gcc, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Jun 29, 2015
2 parents 339a103 + 64049b2 commit 4e5fdcd
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/doc/build-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,25 @@ portable, and standardized. For example, the build script could be written as:
```rust,ignore
// build.rs
// Bring in a dependency on an externally maintained `cc` package which manages
// Bring in a dependency on an externally maintained `gcc` package which manages
// invoking the C compiler.
extern crate cc;
extern crate gcc;
fn main() {
cc::compile_library("libhello.a", &["src/hello.c"]).unwrap();
gcc::compile_library("libhello.a", &["src/hello.c"]).unwrap();
}
```

This example is a little hand-wavy, but we can assume that the `cc` crate
performs tasks such as:
Add a build time dependency on the `gcc` crate with the following addition to
your `Cargo.toml`:

```toml
[build-dependencies]
gcc = "0.3"
```

The [`gcc` crate](https://crates.io/crates/gcc) abstracts a range of build
script requirements for C code:

* It invokes the appropriate compiler (MSVC for windows, `gcc` for MinGW, `cc`
for Unix platforms, etc).
Expand Down

0 comments on commit 4e5fdcd

Please sign in to comment.