Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ keywords = ["window", "metal", "graphics"]
categories = ["game-engines", "graphics"]
exclude = [".github/*"]

[features]
default = ["std"]
std = ["alloc"]
alloc = []

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = "0.5.2"
objc2-foundation = { version = "0.2.2", features = [
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
//! do not modify common `CALayer` properties of the layer that `raw-window-metal` creates, since
//! they may just end up being overwritten (see also "Semantics" above).

#![no_std]
#![cfg(target_vendor = "apple")]
#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc)))]
#![deny(unsafe_op_in_unsafe_fn)]
Expand All @@ -142,6 +143,12 @@ use objc2::{msg_send_id, ClassType};
use objc2_foundation::{MainThreadMarker, NSObject, NSObjectProtocol};
use objc2_quartz_core::{CALayer, CAMetalLayer};

#[cfg(not(feature = "alloc"))]
compile_error!("The `alloc` feature must currently be enabled.");

#[cfg(not(feature = "std"))]
compile_error!("The `std` feature must currently be enabled.");

/// A wrapper around [`CAMetalLayer`].
#[doc(alias = "CAMetalLayer")]
#[derive(Debug, Clone)]
Expand Down
Loading