22 lines
960 B
Rust
22 lines
960 B
Rust
|
|
|
|
fn main() {
|
|
match std::env::var("CARGO_CFG_TARGET_ENV").as_deref() {
|
|
Ok("msvc") => {
|
|
println!("cargo:rustc-link-arg-bins=/HIGHENTROPYVA:NO");
|
|
println!("cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKVersion,DATA");
|
|
println!("cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKPath,DATA");
|
|
println!("cargo:rustc-link-arg-bins=/DELAYLOAD:d3d12.dll");
|
|
println!("cargo:rustc-link-arg-bins=delayimp.lib");
|
|
}
|
|
_ => {
|
|
let out = std::env::var("OUT_DIR").expect("cargo sets OUT_DIR");
|
|
let def = std::path::Path::new(&out).join("eonacat-xs-exports.def");
|
|
std::fs::write(&def, "EXPORTS\nD3D12SDKVersion DATA\nD3D12SDKPath DATA\n")
|
|
.expect("the .def is written into OUT_DIR");
|
|
println!("cargo:rustc-link-arg-bins={}", def.display());
|
|
|
|
println!("cargo:rustc-link-arg-bins=-Wl,--disable-high-entropy-va");
|
|
}
|
|
}
|
|
} |