Struct gcc::Config
[−]
[src]
pub struct Config { // some fields omitted }
Extra configuration to pass to gcc.
Methods
impl Config
fn new() -> Config
Construct a new instance of a blank set of configuration.
This builder is finished with the compile
function.
fn include<P: AsRef<Path>>(&mut self, dir: P) -> &mut Config
Add a directory to the -I
or include path for headers
fn define(&mut self, var: &str, val: Option<&str>) -> &mut Config
Specify a -D
variable with an optional value.
fn object<P: AsRef<Path>>(&mut self, obj: P) -> &mut Config
Add an arbitrary object file to link in
fn flag(&mut self, flag: &str) -> &mut Config
Add an arbitrary flag to the invocation of the compiler
fn file<P: AsRef<Path>>(&mut self, p: P) -> &mut Config
Add a file which will be compiled
fn cpp(&mut self, cpp: bool) -> &mut Config
Set C++ support
fn cpp_stdlib(&mut self, cpp_stdlib: Option<&str>) -> &mut Config
Set the standard library to use when compiling with C++ support.
The default value of this property depends on the current target: On
OS X Some("c++")
is used and for other supported targets
Some("stdc++")
is used.
The choosen library is specified when compiling using the -stdlib
flag
and Cargo is instructed to link to the given library.
A value of None
indicates that no special actions regarding the C++
standard library should be take. This means that neither are linking
instructions provided to Cargo nor is the compiler told to use a
specific standard library.
The given library name must not contain the lib
prefix.
fn compile(&self, output: &str)
Run the compiler, generating the file output
The name output
must begin with lib
and end with .a