diff --git a/Cargo.toml b/Cargo.toml index d464851..ea9ed07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "libretunes" version = "0.1.0" edition = "2021" +build = "src/build.rs" [lib] crate-type = ["cdylib", "rlib"] diff --git a/src/build.rs b/src/build.rs new file mode 100644 index 0000000..32eb98c --- /dev/null +++ b/src/build.rs @@ -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() + ); +}