//use build_target::{target_arch, target_os, Os};
fn main() {
println!("cargo:rustc-link-lib=vulkan");
/*
if target_os().unwrap() == Os::Android {
//libc++abi.a contem os simbolos necessarios para exceptions e rtti
println!("cargo:rustc-link-lib=c++abi");
let target_arch = target_arch().unwrap();
let target_arch = if target_arch == build_target::Arch::X86 {
"i686"
} else {
target_arch.as_str()
}
.to_ascii_uppercase();
let path = std::env::var(format!("ANDROID_NDK_LIB_{}", &target_arch))
.expect(&format!("ANDROID_NDK_LIB_{} missing", &target_arch));
println!("{}", format!("cargo:rustc-link-search=all={}", path));
}
#[cfg(feature = "android_static_stdlib")]
let android_stdlib = "c++_static";
#[cfg(not(feature = "android_static_stdlib"))]
let android_stdlib = "c++_shared";
let compiler = cc::Build::new().get_compiler();
let stdlib = if target_os().unwrap() == Os::Android {
android_stdlib
} else {
if compiler.is_like_clang() {
"c++"
} else if compiler.is_like_gnu() {
"stdc++"
} else {
panic!("compiler not supported, use clang or g++");
}
};
if compiler.is_like_clang() {
cc::Build::new()
.cpp(true)
.flag("-std=c++11")
.flag("-fexceptions")
.flag("-frtti")
.include("extra/VulkanMemoryAllocator/include")
.file("wrapper_build.cpp")
.flag("-Wno-everything")
.static_flag(if cfg!(feature = "android_static_stdlib") {
true
} else {
false
})
.cpp_link_stdlib(stdlib)
.compile("mira_vma");
} else {
cc::Build::new()
.cpp(true)
.flag("-std=c++11")
.flag("-fexceptions")
.flag("-frtti")
.include("extra/VulkanMemoryAllocator/include")
.file("wrapper_build.cpp")
.flag("-Wno-unused-parameter")
.flag("-Wno-unused-variable")
.flag("-Wno-missing-field-initializers")
.flag("-Wno-parentheses")
.flag("-Wno-implicit-fallthrough")
.static_flag(if cfg!(feature = "android_static_stdlib") {
true
} else {
false
})
.cpp_link_stdlib(stdlib)
.compile("mira_vma");
}
*/
}