Files
android-activity/examples/na-openxr-wgpu/build.rs
T
Robert Bragg d5ff06ffb2 Add OpenXR + Wgpu example
This tests being able to write an OpenXR application based on
Wgpu (using the Vulkan HAL backend) for the Oculus Quest.
2022-08-31 20:44:14 +01:00

18 lines
667 B
Rust

fn main() {
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
let android_abi = match std::env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() {
"aarch64" => "arm64-v8a",
"arm" => "armeabi-v7a",
"x86" => "x86",
"x86_64" => "x86_64",
arch => {
panic!("Unsupported architecture for Android {arch}");
}
};
let libdir = std::path::Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap())
.join(format!("app/src/main/jniLibs/{android_abi}/lib"));
println!("cargo:rustc-link-search={}", libdir.to_string_lossy());
}
}