target-tuple 1.0.2

TARGET and HOST tuples
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented0 out of 2 items with examples
  • Size
  • Source code size: 19.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 38.7 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dtolnay/target-tuple
    18 4 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dtolnay

Rustc target tuple

Access the $TARGET and $HOST rustc target tuples that Cargo supplies to build scripts.

Example

fn main() {
    // As a const &str:
    assert_eq!(target_tuple::TARGET, "x86_64-unknown-linux-gnu");

    // As a string literal:
    assert_eq!(
        concat!("target/", target_tuple::target!()),
        "target/x86_64-unknown-linux-gnu",
    );
}

License