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

#353 in Build Utils

Download history 854/week @ 2024-07-20 1236/week @ 2024-07-27 1238/week @ 2024-08-03 1140/week @ 2024-08-10 789/week @ 2024-08-17 1325/week @ 2024-08-24 1048/week @ 2024-08-31 783/week @ 2024-09-07 761/week @ 2024-09-14 789/week @ 2024-09-21 1436/week @ 2024-09-28 836/week @ 2024-10-05 3581/week @ 2024-10-12 51415/week @ 2024-10-19 62083/week @ 2024-10-26 58527/week @ 2024-11-02

175,738 downloads per month
Used in 1,243 crates (7 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