cross compile libs
This commit is contained in:
parent
16a3328c42
commit
8129b9f840
1 changed files with 18 additions and 0 deletions
18
lib/build.rs
18
lib/build.rs
|
@ -1,6 +1,24 @@
|
|||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
#[cfg(feature = "vulkan-renderer")]
|
||||
{
|
||||
let host_triple = std::env::var("HOST").unwrap();
|
||||
let target_triple = std::env::var("TARGET").unwrap();
|
||||
|
||||
if host_triple != target_triple {
|
||||
// cross compile
|
||||
if !host_triple.contains("windows") && target_triple.contains("x86_64-pc-windows") {
|
||||
println!(
|
||||
"cargo:rustc-link-search={}",
|
||||
std::env::var("VULKAN_SDK_WIN")
|
||||
.expect("Could not find windows vulkan sdk path")
|
||||
);
|
||||
println!(
|
||||
"cargo:rustc-link-search={}",
|
||||
std::env::var("SHADERC_WIN").expect("Could not find windows shaderc path")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const SHADER_SRC_DIR: &str = "src/renderer/vulkan/shaders";
|
||||
const SHADER_OUT_DIR: &str = "shaders";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue