Add build script to set target configuration variable

This commit is contained in:
2024-01-23 22:30:06 -05:00
parent 18e2a8c634
commit 1d7f27a491
2 changed files with 10 additions and 0 deletions

9
src/build.rs Normal file
View File

@ -0,0 +1,9 @@
// Set the target config variable to the target triple of the current build
// This is used so we can determine the target triple at compile time
// See https://stackoverflow.com/a/51311222
fn main() {
println!(
"cargo:rustc-cfg=target=\"{}\"",
std::env::var("TARGET").unwrap()
);
}