Merge pull request #597 from nicokoch/macos-fixes

Fix build warnings on macos
This commit is contained in:
tomaka 2017-07-05 14:11:04 +02:00 committed by GitHub
commit c24e67365f
2 changed files with 4 additions and 5 deletions

View File

@ -12,8 +12,6 @@ use std::env;
fn main() {
let target = env::var("TARGET").unwrap();
if target.contains("apple-darwin") {
println!("cargo:rustc-link-search=framework={}",
"/Library/Frameworks"); // TODO: necessary?
println!("cargo:rustc-link-lib=c++");
println!("cargo:rustc-link-lib=framework=MoltenVK");
println!("cargo:rustc-link-lib=framework=QuartzCore");

View File

@ -10,13 +10,11 @@
use std::error;
use std::fmt;
use std::mem;
use std::path::Path;
use std::ptr;
use shared_library;
use vk;
#[cfg(any(target_os = "macos", target_os = "ios"))]
#[allow(non_snake_case)]
fn load_static() -> Result<vk::Static, LoadingError> {
use std::os::raw::c_char;
@ -35,6 +33,9 @@ fn load_static() -> Result<vk::Static, LoadingError> {
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
fn load_static() -> Result<vk::Static, LoadingError> {
use std::path::Path;
use std::ptr;
use shared_library;
lazy_static! {
static ref VK_LIB: Result<shared_library::dynamic_library::DynamicLibrary, LoadingError> = {
#[cfg(windows)] fn get_path() -> &'static Path { Path::new("vulkan-1.dll") }