3 releases

0.1.2 Dec 21, 2023
0.1.1 Dec 21, 2023
0.1.0 Dec 21, 2023

#289 in Build Utils

Download history 93/week @ 2023-12-22 72/week @ 2023-12-29 313/week @ 2024-01-05 127/week @ 2024-01-12 153/week @ 2024-01-19 129/week @ 2024-01-26 317/week @ 2024-02-02 353/week @ 2024-02-09 290/week @ 2024-02-16 243/week @ 2024-02-23 234/week @ 2024-03-01 657/week @ 2024-03-08 539/week @ 2024-03-15 437/week @ 2024-03-22 407/week @ 2024-03-29 595/week @ 2024-04-05

2,062 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

7KB

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