Skip to content

Commit a761285

Browse files
Remove compile_library function
1 parent 2b0d2be commit a761285

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ Next up, you'll want to write a build script like so:
3535
extern crate gcc;
3636
3737
fn main() {
38-
gcc::compile_library("libfoo.a", &["foo.c", "bar.c"]);
38+
gcc::Config::new()
39+
.files(["foo.c", "bar.c"])
40+
.compile("libfoo.a");
3941
}
4042
```
4143

src/lib.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,14 @@
1010
//!
1111
//! The purpose of this crate is to provide the utility functions necessary to
1212
//! compile C code into a static archive which is then linked into a Rust crate.
13-
//! The top-level `compile_library` function serves as a convenience and more
14-
//! advanced configuration is available through the `Config` builder.
13+
//! Configuration is available through the `Config` builder.
1514
//!
1615
//! This crate will automatically detect situations such as cross compilation or
1716
//! other environment variables set by Cargo and will build code appropriately.
1817
//!
1918
//! # Examples
2019
//!
21-
//! Use the default configuration:
22-
//!
23-
//! ```no_run
24-
//! extern crate gcc;
25-
//!
26-
//! fn main() {
27-
//! gcc::compile_library("libfoo.a", &["src/foo.c"]);
28-
//! }
29-
//! ```
30-
//!
31-
//! Use more advanced configuration:
20+
//! Use the `Config` builder to compile `src/foo.c`:
3221
//!
3322
//! ```no_run
3423
//! extern crate gcc;
@@ -170,6 +159,8 @@ impl ToolFamily {
170159
/// ```no_run
171160
/// gcc::compile_library("libfoo.a", &["foo.c", "bar.c"]);
172161
/// ```
162+
#[deprecated]
163+
#[doc(hidden)]
173164
pub fn compile_library(output: &str, files: &[&str]) {
174165
let mut c = Config::new();
175166
for f in files.iter() {

0 commit comments

Comments
 (0)