4 releases

new 0.1.3 May 14, 2024
0.1.2 Dec 21, 2023
0.1.1 Dec 21, 2023
0.1.0 Dec 21, 2023

#242 in Build Utils

Download history 130/week @ 2024-01-25 297/week @ 2024-02-01 368/week @ 2024-02-08 253/week @ 2024-02-15 274/week @ 2024-02-22 226/week @ 2024-02-29 607/week @ 2024-03-07 525/week @ 2024-03-14 489/week @ 2024-03-21 376/week @ 2024-03-28 605/week @ 2024-04-04 432/week @ 2024-04-11 368/week @ 2024-04-18 415/week @ 2024-04-25 382/week @ 2024-05-02 249/week @ 2024-05-09

1,461 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

7KB
55 lines

Rustc target triple

github crates.io docs.rs build status

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

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps