initial work

This commit is contained in:
David Lin 2017-10-14 11:44:15 +08:00
parent 1b39f34e02
commit 5371c96108
2 changed files with 10 additions and 1 deletions

View file

@ -14,5 +14,9 @@ shared_library = "0.1.5"
lazy_static = "0.2.1" lazy_static = "0.2.1"
libc = "0.2.26" libc = "0.2.26"
[features]
default = []
moltenvk = []
[package.metadata.release] [package.metadata.release]
no-dev-version = true no-dev-version = true

View file

@ -15,7 +15,7 @@ fn get_path() -> &'static Path {
Path::new("vulkan-1.dll") Path::new("vulkan-1.dll")
} }
#[cfg(all(unix, not(target_os = "android")))] #[cfg(all(unix, not(any(feature = "moltenvk", target_os = "android"))))]
fn get_path() -> &'static Path { fn get_path() -> &'static Path {
Path::new("libvulkan.so.1") Path::new("libvulkan.so.1")
} }
@ -25,6 +25,11 @@ fn get_path() -> &'static Path {
Path::new("libvulkan.so") Path::new("libvulkan.so")
} }
#[cfg(all(feature = "moltenvk", any(target_os = "macos", target_os = "ios")))]
fn get_path() -> &'static Path {
Path::new("libMoltenVK.dylib")
}
lazy_static!{ lazy_static!{
static ref VK_LIB: Result<DynamicLibrary, String> = DynamicLibrary::open(Some(get_path())); static ref VK_LIB: Result<DynamicLibrary, String> = DynamicLibrary::open(Some(get_path()));
} }