Add build script to set target configuration variable
This commit is contained in:
parent
18e2a8c634
commit
1d7f27a491
@ -2,6 +2,7 @@
|
|||||||
name = "libretunes"
|
name = "libretunes"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
build = "src/build.rs"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
9
src/build.rs
Normal file
9
src/build.rs
Normal 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()
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user