mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 06:45:23 +00:00
Use #[cfg] for the OSX code in vulkano-win
This commit is contained in:
parent
40e0b24127
commit
c6fb7a84bd
@ -10,6 +10,8 @@ categories = ["rendering::graphics-api"]
|
||||
[dependencies]
|
||||
vulkano = { version = "0.3.0", path = "../vulkano" }
|
||||
winit = "0.6.4"
|
||||
metal-rs = "0.3"
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
metal-rs = "0.3.0"
|
||||
cocoa = "0.8.1"
|
||||
objc = ""
|
||||
objc = "0.2"
|
||||
|
@ -1,8 +1,11 @@
|
||||
extern crate vulkano;
|
||||
extern crate winit;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate objc;
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate cocoa;
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate metal_rs as metal;
|
||||
|
||||
use std::error;
|
||||
@ -17,11 +20,13 @@ use vulkano::swapchain::SurfaceCreationError;
|
||||
use winit::{EventsLoop, WindowBuilder};
|
||||
use winit::CreationError as WindowCreationError;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use objc::runtime::{YES};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use cocoa::base::id as cocoa_id;
|
||||
#[cfg(target_os = "macos")]
|
||||
use cocoa::appkit::{NSWindow, NSView};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use metal::*;
|
||||
|
||||
use std::mem;
|
||||
|
Loading…
Reference in New Issue
Block a user