target-triple

TARGET and HOST triples

APACHE-2.0 License

Downloads
28.5K
Stars
16

Rustc target triple

Access the $TARGET and $HOST rustc target triples that Cargo supplies to build scripts.

Example

fn main() {
    // As a const &str:
    assert_eq!(target_triple::TARGET, "x86_64-unknown-linux-gnu");

    // As a string literal:
    assert_eq!(
        concat!("target/", target_triple::target!()),
        "target/x86_64-unknown-linux-gnu",
    );
}

License