diff options
author | Daniel Mueller <deso@posteo.net> | 2017-09-16 08:37:31 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2017-09-16 08:37:31 -0700 |
commit | ab3c2a935b1ba655de2f3fec35da2c14b69966dc (patch) | |
tree | cb546a86fe9648b2afcd78776d7e035a05c04b76 /gcc/README.md | |
parent | ea4ea0e5fced2780c569b2e420e56f47f62adca8 (diff) | |
download | nitrocli-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.md | 14 |
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"); |