Linker

Trait Linker 

Source
pub trait Linker {
    // Required methods
    fn name(&self) -> &'static OsStr;
    fn output(&self, cmd: &mut Command, path: &OsStr);
    fn lib(&self, cmd: &mut Command, path: &OsStr);
    fn path(&self, cmd: &mut Command, path: &OsStr);

    // Provided methods
    fn default_output(&self) -> &'static OsStr { ... }
    fn preproc(&self, cmd: &mut Command) { ... }
    fn obj(&self, cmd: &mut Command, path: &OsStr) { ... }
}
Expand description

The Trait to Integrate Linkers

Required Methods§

Source

fn name(&self) -> &'static OsStr

Return the name of your linker.

Source

fn output(&self, cmd: &mut Command, path: &OsStr)

Set the output file. (like ld -o)

Source

fn lib(&self, cmd: &mut Command, path: &OsStr)

Search and add library in the library path. (like ld -l)

Source

fn path(&self, cmd: &mut Command, path: &OsStr)

Add library searching path. (like ld -L)

Provided Methods§

Source

fn default_output(&self) -> &'static OsStr

Return the default output file.

As the default, this function returns "a.out".

Source

fn preproc(&self, cmd: &mut Command)

Preprocess the linker. (set required arguments, variables, etc.)

As the default, this function does nothing.

Source

fn obj(&self, cmd: &mut Command, path: &OsStr)

Add an object.

As the default, this function just adds the path to the arguments.

Implementors§