aboutsummaryrefslogtreecommitdiff
path: root/gcc/README.md
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-09-16 08:37:31 -0700
committerDaniel Mueller <deso@posteo.net>2017-09-16 08:37:31 -0700
commitab3c2a935b1ba655de2f3fec35da2c14b69966dc (patch)
treecb546a86fe9648b2afcd78776d7e035a05c04b76 /gcc/README.md
parentea4ea0e5fced2780c569b2e420e56f47f62adca8 (diff)
downloadnitrocli-ab3c2a935b1ba655de2f3fec35da2c14b69966dc.tar.gz
nitrocli-ab3c2a935b1ba655de2f3fec35da2c14b69966dc.tar.bz2
Update gcc crate to 0.3.54
Import subrepo gcc/:gcc at dc329205d54b53a45ab66368aed265b68fe7f261
Diffstat (limited to 'gcc/README.md')
-rw-r--r--gcc/README.md14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/README.md b/gcc/README.md
index 2d3e5ed..06bfa27 100644
--- a/gcc/README.md
+++ b/gcc/README.md
@@ -35,13 +35,17 @@ Next up, you'll want to write a build script like so:
extern crate gcc;
fn main() {
- gcc::compile_library("libfoo.a", &["foo.c", "bar.c"]);
+ gcc::Build::new()
+ .file("foo.c")
+ .file("bar.c")
+ .compile("foo");
}
```
And that's it! Running `cargo build` should take care of the rest and your Rust
-application will now have the C files `foo.c` and `bar.c` compiled into it. You
-can call the functions in Rust by declaring functions in your Rust code like so:
+application will now have the C files `foo.c` and `bar.c` compiled into a file
+named libfoo.a. You can call the functions in Rust by declaring functions in
+your Rust code like so:
```
extern {
@@ -137,13 +141,13 @@ required varies per platform, but there are three broad categories:
## C++ support
`gcc-rs` supports C++ libraries compilation by using the `cpp` method on
-`Config`:
+`Build`:
```rust,no_run
extern crate gcc;
fn main() {
- gcc::Config::new()
+ gcc::Build::new()
.cpp(true) // Switch to C++ library compilation.
.file("foo.cpp")
.compile("libfoo.a");