[][src]Macro cargo_emit::rustc_link_lib

macro_rules! rustc_link_lib {
    ($name:literal $(,)?) => { ... };
    ($name:expr $(,)?) => { ... };
    ($name:literal => $kind:literal $(,)?) => { ... };
    ($name:expr => $kind:expr $(,)?) => { ... };
    ($($name:expr $(=> $kind:expr)?),+ $(,)?) => { ... };
}

Tells Cargo to pass $lib to the compiler as a -l flag.

This is equivalent to:

println!("cargo:rustc-link-lib=[$kind=]$name");

Examples

Useful for telling the linker what libraries should be linked.

cargo_emit::rustc_link_lib! {
    "ssl", // same as `=> "dylib"`
    "ruby" => "static",
    "CoreFoundation" => "framework",
}