diff --git a/Cargo.toml b/Cargo.toml index c6a301c..ab1f6c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gcc" -version = "0.1.1" +version = "0.1.2" authors = ["Alex Crichton "] license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/gcc-rs" diff --git a/src/lib.rs b/src/lib.rs index 4937227..5e52215 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,6 +10,8 @@ pub struct Config { pub definitions: Vec<(String, Option)>, /// Additional object files to link into the final archive pub objects: Vec, + /// Additional flags and parameter to pass to the compiler + pub flags: Vec, } impl Default for Config { @@ -18,6 +20,7 @@ impl Default for Config { include_directories: Vec::new(), definitions: Vec::new(), objects: Vec::new(), + flags: Vec::new(), } } } @@ -75,6 +78,10 @@ pub fn compile_library(output: &str, config: &Config, files: &[&str]) { cmd.arg("-I").arg(directory); } + for flag in config.flags.iter() { + cmd.arg(flag); + } + for &(ref key, ref value) in config.definitions.iter() { if let &Some(ref value) = value { cmd.arg(format!("-D{}={}", key, value));