5 releases

0.1.4 Feb 20, 2025
0.1.3 May 14, 2024
0.1.2 Dec 21, 2023
0.1.1 Dec 21, 2023
0.1.0 Dec 21, 2023

#346 in Build Utils

Download history 66898/week @ 2024-11-16 72369/week @ 2024-11-23 83190/week @ 2024-11-30 81252/week @ 2024-12-07 79705/week @ 2024-12-14 34985/week @ 2024-12-21 43845/week @ 2024-12-28 77566/week @ 2025-01-04 88670/week @ 2025-01-11 84153/week @ 2025-01-18 90324/week @ 2025-01-25 98515/week @ 2025-02-01 103198/week @ 2025-02-08 110072/week @ 2025-02-15 144049/week @ 2025-02-22 142255/week @ 2025-03-01

517,875 downloads per month
Used in 1,360 crates (8 directly)

MIT/Apache

8KB
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