4 releases

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

#473 in Build Utils

Download history 674/week @ 2024-06-14 768/week @ 2024-06-21 971/week @ 2024-06-28 836/week @ 2024-07-05 732/week @ 2024-07-12 919/week @ 2024-07-19 1044/week @ 2024-07-26 1202/week @ 2024-08-02 1316/week @ 2024-08-09 840/week @ 2024-08-16 1114/week @ 2024-08-23 1152/week @ 2024-08-30 844/week @ 2024-09-06 764/week @ 2024-09-13 794/week @ 2024-09-20 1373/week @ 2024-09-27

3,934 downloads per month
Used in 8 crates (5 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