File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ Next up, you'll want to write a build script like so:
35
35
extern crate gcc;
36
36
37
37
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");
39
41
}
40
42
```
41
43
Original file line number Diff line number Diff line change 10
10
//!
11
11
//! The purpose of this crate is to provide the utility functions necessary to
12
12
//! 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.
15
14
//!
16
15
//! This crate will automatically detect situations such as cross compilation or
17
16
//! other environment variables set by Cargo and will build code appropriately.
18
17
//!
19
18
//! # Examples
20
19
//!
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`:
32
21
//!
33
22
//! ```no_run
34
23
//! extern crate gcc;
@@ -170,6 +159,8 @@ impl ToolFamily {
170
159
/// ```no_run
171
160
/// gcc::compile_library("libfoo.a", &["foo.c", "bar.c"]);
172
161
/// ```
162
+ #[ deprecated]
163
+ #[ doc( hidden) ]
173
164
pub fn compile_library ( output : & str , files : & [ & str ] ) {
174
165
let mut c = Config :: new ( ) ;
175
166
for f in files. iter ( ) {
You can’t perform that action at this time.
0 commit comments