From 210befcda93f35a06f62ec1a1d136e4133d2b62f Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 19 Dec 2024 03:15:05 +0100 Subject: [PATCH] Make objc2 optional when translating frameworks --- crates/header-translator/src/context.rs | 6 +- crates/header-translator/src/id.rs | 80 ++++++++++++------- crates/header-translator/src/library.rs | 10 +++ crates/header-translator/src/module.rs | 22 ++--- crates/header-translator/src/rust_type.rs | 4 +- crates/header-translator/src/stmt.rs | 55 ++++++++++--- crates/objc2/src/__framework_prelude.rs | 7 -- .../objc2-accessibility/Cargo.toml | 4 +- framework-crates/objc2-app-kit/Cargo.toml | 4 +- .../objc2-audio-toolbox/Cargo.toml | 4 +- .../objc2-authentication-services/Cargo.toml | 2 +- framework-crates/objc2-automator/Cargo.toml | 2 +- .../objc2-av-foundation/Cargo.toml | 8 +- framework-crates/objc2-av-kit/Cargo.toml | 4 +- framework-crates/objc2-avf-audio/Cargo.toml | 4 +- .../objc2-business-chat/Cargo.toml | 2 +- framework-crates/objc2-class-kit/Cargo.toml | 2 +- framework-crates/objc2-contacts-ui/Cargo.toml | 2 +- .../objc2-core-audio-types/Cargo.toml | 8 +- .../translation-config.toml | 2 +- .../objc2-core-bluetooth/Cargo.toml | 2 +- .../objc2-core-foundation/Cargo.toml | 8 +- .../objc2-core-foundation/src/geometry.rs | 9 +++ .../translation-config.toml | 2 +- .../objc2-core-graphics/Cargo.toml | 8 +- .../translation-config.toml | 2 +- framework-crates/objc2-core-image/Cargo.toml | 8 +- framework-crates/objc2-core-media/Cargo.toml | 8 +- .../objc2-core-media/translation-config.toml | 2 +- framework-crates/objc2-core-ml/Cargo.toml | 4 +- framework-crates/objc2-core-text/Cargo.toml | 8 +- .../objc2-core-text/src/sfnt_lookup_header.rs | 2 + .../objc2-core-text/translation-config.toml | 2 +- framework-crates/objc2-core-video/Cargo.toml | 8 +- .../objc2-core-video/translation-config.toml | 2 +- framework-crates/objc2-core-wlan/Cargo.toml | 2 +- framework-crates/objc2-event-kit/Cargo.toml | 2 +- .../objc2-file-provider/Cargo.toml | 2 +- framework-crates/objc2-foundation/Cargo.toml | 2 +- .../objc2-game-controller/Cargo.toml | 2 +- framework-crates/objc2-game-kit/Cargo.toml | 2 +- .../objc2-input-method-kit/Cargo.toml | 2 +- framework-crates/objc2-io-surface/Cargo.toml | 8 +- .../objc2-io-surface/translation-config.toml | 2 +- .../objc2-link-presentation/Cargo.toml | 2 +- .../Cargo.toml | 2 +- framework-crates/objc2-map-kit/Cargo.toml | 4 +- .../objc2-media-player/Cargo.toml | 4 +- framework-crates/objc2-metal-kit/Cargo.toml | 4 +- .../Cargo.toml | 4 +- framework-crates/objc2-metal/Cargo.toml | 4 +- .../objc2-open-directory/Cargo.toml | 2 +- framework-crates/objc2-osa-kit/Cargo.toml | 2 +- framework-crates/objc2-photos-ui/Cargo.toml | 2 +- framework-crates/objc2-photos/Cargo.toml | 4 +- framework-crates/objc2-quartz-core/Cargo.toml | 6 +- .../objc2-screen-capture-kit/Cargo.toml | 6 +- .../objc2-screen-saver/Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../objc2-sound-analysis/Cargo.toml | 2 +- framework-crates/objc2-speech/Cargo.toml | 2 +- framework-crates/objc2-store-kit/Cargo.toml | 2 +- framework-crates/objc2-ui-kit/Cargo.toml | 4 +- .../objc2-virtualization/Cargo.toml | 2 +- framework-crates/objc2-vision/Cargo.toml | 8 +- framework-crates/objc2-web-kit/Cargo.toml | 2 +- generated | 2 +- 67 files changed, 248 insertions(+), 157 deletions(-) diff --git a/crates/header-translator/src/context.rs b/crates/header-translator/src/context.rs index 29a1ec6bd..564368c6e 100644 --- a/crates/header-translator/src/context.rs +++ b/crates/header-translator/src/context.rs @@ -33,14 +33,18 @@ impl MacroLocation { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroEntity { + /// The name and location of the macro definition. pub(crate) id: ItemIdentifier, pub(crate) is_function_like: bool, } impl MacroEntity { pub fn from_entity(entity: &Entity<'_>, context: &Context<'_>) -> Self { + let definition = entity.get_definition(); Self { - id: ItemIdentifier::new(entity, context), + // Try to get location from the definition itself, but if that + // doesn't exist, let's just get it from the entity. + id: ItemIdentifier::new(definition.as_ref().unwrap_or(entity), context), is_function_like: entity.is_function_like_macro(), } } diff --git a/crates/header-translator/src/id.rs b/crates/header-translator/src/id.rs index d5ef2c101..0879bd218 100644 --- a/crates/header-translator/src/id.rs +++ b/crates/header-translator/src/id.rs @@ -60,12 +60,18 @@ impl Location { // These types are redefined in the framework crate itself. "Darwin.MacTypes" => "__builtin__".into(), + // int8_t, int16_t etc., translated to i8, i16 etc. + "_stdint" => "__builtin__".into(), + // Implementation of the above + "DarwinFoundation.types.machine_types" => "__builtin__".into(), + // `core::ffi` types - "DarwinFoundation.types.machine_types" => "__core__.ffi".into(), "_Builtin_stdarg.va_list" => { - error!("va_list is not yet supported"); + warn!("va_list is not yet supported"); "__core__.ffi".into() } + // c_float and c_double + "_float" | "_Builtin_float" => "__core__.ffi".into(), // `libc` name if name.starts_with("sys_types") => "__libc__".into(), @@ -169,26 +175,6 @@ impl Location { } } - /// The place from where a given item exists. - pub fn import(&self, config: &Config, emission_library: &str) -> Option> { - match self.library_name() { - "__builtin__" => None, - // TODO: Use `core::xyz` here. - "__core__" => None, - // Rare enough that it's written directly instead of - // glob-imported, see `ItemIdentifier::path`. - "__bitflags__" | "__libc__" | "block" => None, - "ObjectiveC" => Some("objc2::__framework_prelude".into()), - // Not currently needed, but might be useful to emit - // `Some("crate")` here in the future. - library if library == emission_library => None, - library => { - let krate = &config.library(library).krate; - Some(krate.replace('-', "_").into()) - } - } - } - // Feature names are based on the file name, not the whole path to the feature. pub fn cargo_toml_feature(&self, config: &Config, emission_library: &str) -> Option { match self.library_name() { @@ -240,7 +226,11 @@ impl Location { // FIXME: This is currently wrong for nested umbrella frameworks // (specifically MetalPerformanceShaders). - fn cfg_feature<'a>(&self, config: &'a Config, emission_library: &str) -> Option> { + pub fn cfg_feature<'a>( + &self, + config: &'a Config, + emission_library: &str, + ) -> Option> { match self.library_name() { "__builtin__" | "__core__" => None, library if library == emission_library => { @@ -317,10 +307,14 @@ impl ItemIdentifier { .get_location() .unwrap_or_else(|| panic!("no entity location: {entity:?}")) .get_expansion_location() - .file - .expect("expanded location file"); + .file; - let mut location = Location::from_file(file); + let mut location = if let Some(file) = file { + Location::from_file(file) + } else { + // Assume item to be a built-in macro like __nonnull if no file. + Location::new("__builtin__") + }; // Defined in multiple places for some reason. if let Some("IOSurfaceRef" | "__IOSurface") = name.to_option() { @@ -399,14 +393,14 @@ impl ItemIdentifier { pub fn core_ffi(name: &str) -> Self { Self { name: name.into(), - location: Location::new("ObjectiveC"), // Temporary + location: Location::new("__core__.ffi"), } } - pub fn core_ptr(name: &str) -> Self { + pub fn core_ptr_nonnull() -> Self { Self { - name: name.into(), - location: Location::new("ObjectiveC"), // Temporary + name: "NonNull".into(), + location: Location::new("__core__.ptr"), } } @@ -433,6 +427,32 @@ impl ItemIdentifier { self.location.library_name() == "Foundation" && self.name == "NSComparator" } + /// The import needed for a given item to exist. + pub fn import(&self, config: &Config, emission_library: &str) -> Option> { + match self.library_name() { + "__builtin__" => None, + "__core__" => match &*self.location().module_path { + "__core__.ffi" => Some("core::ffi::*".into()), + "__core__.ptr" if self.name == "NonNull" => Some("core::ptr::NonNull".into()), + _ => { + error!("unknown __core__: {self:?}"); + None + } + }, + // Rare enough that it's written directly instead of + // glob-imported, see `ItemIdentifier::path` below. + "__bitflags__" | "__libc__" | "block" => None, + "ObjectiveC" => Some("objc2::__framework_prelude::*".into()), + // Not currently needed, but might be useful to emit + // `Some("crate")` here in the future. + library if library == emission_library => None, + library => { + let krate = &config.library(library).krate; + Some(format!("{}::*", krate.replace('-', "_")).into()) + } + } + } + pub fn path(&self) -> impl fmt::Display + '_ { struct ItemIdentifierPath<'a>(&'a ItemIdentifier); diff --git a/crates/header-translator/src/library.rs b/crates/header-translator/src/library.rs index 51e87037e..df7b635b0 100644 --- a/crates/header-translator/src/library.rs +++ b/crates/header-translator/src/library.rs @@ -106,6 +106,16 @@ impl Library { } } + // Encode need the inner encode impl to be available. + if self.data.required_crates.contains("objc2") { + for (krate, (_, _, krate_features)) in &mut dependencies { + let data = config.library_from_crate(krate); + if !data.required_crates.contains("objc2") && !data.skipped { + krate_features.insert("objc2".into()); + } + } + } + dependencies } diff --git a/crates/header-translator/src/module.rs b/crates/header-translator/src/module.rs index 51c275d04..3c7342e9c 100644 --- a/crates/header-translator/src/module.rs +++ b/crates/header-translator/src/module.rs @@ -80,25 +80,29 @@ impl Module { .iter() .flat_map(|stmt| stmt.required_items_inner()) .filter_map(|item| { - item.location() - .import(config, emission_library) - .map(|import_data| (item.library_name().to_string(), import_data)) + item.import(config, emission_library).map(|import| { + ( + import, + ( + item.location().cfg_feature(config, emission_library), + item.library_name().to_string(), + ), + ) + }) }) .collect(); let emission_config = &config.library(emission_library); - for (library_name, import) in imports { - let krate = &config.library(&library_name).krate; - let required = emission_config.required_crates.contains(krate); - if !required { - writeln!(f, "#[cfg(feature = {krate:?})]")?; + for (import, (cfg_feature, library_name)) in imports { + if let Some(cfg_feature) = cfg_feature { + writeln!(f, "#[cfg(feature = {cfg_feature:?})]")?; } let mut platform_cfg = PlatformCfg::from_config(emission_config); platform_cfg.dependency(config.library(&library_name)); if let Some(cfg) = platform_cfg.cfgs() { writeln!(f, "#[cfg({cfg})]")?; } - writeln!(f, "use {import}::*;")?; + writeln!(f, "use {import};")?; } writeln!(f)?; writeln!(f, "use crate::*;")?; diff --git a/crates/header-translator/src/rust_type.rs b/crates/header-translator/src/rust_type.rs index 4d73f46f6..8694f8444 100644 --- a/crates/header-translator/src/rust_type.rs +++ b/crates/header-translator/src/rust_type.rs @@ -1159,7 +1159,7 @@ impl Ty { } => { let mut items = pointee.required_items(); if *nullability == Nullability::NonNull { - items.push(ItemIdentifier::core_ptr("NonNull")); + items.push(ItemIdentifier::core_ptr_nonnull()); } items } @@ -1172,7 +1172,7 @@ impl Ty { let mut items = to.required_items(); items.push(id.clone()); if *nullability == Nullability::NonNull { - items.push(ItemIdentifier::core_ptr("NonNull")); + items.push(ItemIdentifier::core_ptr_nonnull()); } items } diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs index 61eb02e20..339f35af9 100644 --- a/crates/header-translator/src/stmt.rs +++ b/crates/header-translator/src/stmt.rs @@ -1544,15 +1544,10 @@ impl Stmt { for (_, field_ty) in fields { items.extend(field_ty.required_items()); } - items.push(ItemIdentifier::objc("Encoding")); items } // Variants manage required items themselves - Self::EnumDecl { ty, .. } => { - let mut items = ty.required_items(); - items.push(ItemIdentifier::objc("Encoding")); - items - } + Self::EnumDecl { ty, .. } => ty.required_items(), Self::ConstDecl { ty, value, .. } => { let mut items = ty.required_items(); items.extend(value.required_items()); @@ -1600,6 +1595,7 @@ impl Stmt { .iter() .flat_map(|method| method.required_items()) .collect(), + Self::StructDecl { .. } => vec![ItemIdentifier::objc("Encoding")], Self::EnumDecl { kind, variants, .. } => { let mut items: Vec<_> = variants .iter() @@ -1608,6 +1604,7 @@ impl Stmt { if let Some(UnexposedAttr::Options) = kind { items.push(ItemIdentifier::bitflags()); } + items.push(ItemIdentifier::objc("Encoding")); items } _ => vec![], @@ -1720,6 +1717,13 @@ impl Stmt { return Ok(()); } + let cfg = cfg_gate_ln( + [ItemIdentifier::objc("extern_class")], + [self.location()], + config, + self.location(), + ); + write!(f, "{cfg}")?; writeln!(f, "extern_class!(")?; writeln!(f, " /// {}", id.doc_link())?; write!(f, " #[unsafe(super(")?; @@ -1772,6 +1776,13 @@ impl Stmt { category_name, methods, } => { + let cfg = cfg_gate_ln( + [ItemIdentifier::objc("extern_methods")], + [self.location()], + config, + self.location(), + ); + write!(f, "{cfg}")?; writeln!(f, "extern_methods!(")?; if let Some(source_superclass) = source_superclass { writeln!( @@ -1845,6 +1856,13 @@ impl Stmt { cls_required_items, methods, } => { + let cfg = cfg_gate_ln( + [ItemIdentifier::objc("extern_category")], + [self.location()], + config, + self.location(), + ); + write!(f, "{cfg}")?; writeln!(f, "extern_category!(")?; if let Some(actual_name) = actual_name { @@ -2038,6 +2056,13 @@ impl Stmt { required_sendable: _, required_mainthreadonly, } => { + let cfg = cfg_gate_ln( + [ItemIdentifier::objc("extern_protocol")], + [self.location()], + config, + self.location(), + ); + write!(f, "{cfg}")?; writeln!(f, "extern_protocol!(")?; writeln!(f, " /// {}", id.doc_link())?; @@ -2141,6 +2166,11 @@ impl Stmt { writeln!(f, "}}")?; writeln!(f)?; + let mut required_items = self.required_items(); + required_items.push(ItemIdentifier::objc("Encoding")); + let cfg_encoding = + cfg_gate_ln(required_items, [self.location()], config, self.location()); + let encoding = FormatterFn(|f| { write!( f, @@ -2155,9 +2185,9 @@ impl Stmt { }); // SAFETY: The struct is marked `#[repr(C)]`. - write!(f, "{}", self.cfg_gate_ln(config))?; + write!(f, "{cfg_encoding}")?; writeln!(f, "{}", unsafe_impl_encode(&id.name, encoding))?; - write!(f, "{}", self.cfg_gate_ln(config))?; + write!(f, "{cfg_encoding}")?; writeln!(f, "{}", unsafe_impl_refencode(&id.name))?; if let Some(true) = sendable { @@ -2316,12 +2346,17 @@ impl Stmt { _ => panic!("invalid enum kind"), } + let mut required_items = self.required_items(); + required_items.push(ItemIdentifier::objc("Encoding")); + let cfg_encoding = + cfg_gate_ln(required_items, [self.location()], config, self.location()); + // SAFETY: The enum is either a `#[repr(transparent)]` newtype // over the type, or a `#[repr(REPR)]`, where REPR is a valid // repr with the same size and alignment as the type. - write!(f, "{}", self.cfg_gate_ln(config))?; + write!(f, "{cfg_encoding}")?; writeln!(f, "{}", unsafe_impl_encode(&id.name, ty.enum_encoding()))?; - write!(f, "{}", self.cfg_gate_ln(config))?; + write!(f, "{cfg_encoding}")?; writeln!(f, "{}", unsafe_impl_refencode(&id.name))?; if let Some(true) = sendable { diff --git a/crates/objc2/src/__framework_prelude.rs b/crates/objc2/src/__framework_prelude.rs index a5b2f4ca0..4af45ed8c 100644 --- a/crates/objc2/src/__framework_prelude.rs +++ b/crates/objc2/src/__framework_prelude.rs @@ -3,13 +3,6 @@ // Note: While this is not public, it is still a breaking change to remove // entries in here, since framework crates rely on it. -pub use core::ffi::{ - c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, - c_ulong, c_ulonglong, c_ushort, c_void, -}; -pub use core::marker::PhantomData; -pub use core::ptr::NonNull; - pub use crate::encode::{Encode, Encoding, RefEncode}; pub use crate::ffi::{NSInteger, NSIntegerMax, NSUInteger, NSUIntegerMax}; pub use crate::rc::{Allocated, DefaultRetained, Retained}; diff --git a/framework-crates/objc2-accessibility/Cargo.toml b/framework-crates/objc2-accessibility/Cargo.toml index 2581f91f4..f69345fb0 100644 --- a/framework-crates/objc2-accessibility/Cargo.toml +++ b/framework-crates/objc2-accessibility/Cargo.toml @@ -19,8 +19,8 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-app-kit/Cargo.toml b/framework-crates/objc2-app-kit/Cargo.toml index 3277f09ac..c0805bc18 100644 --- a/framework-crates/objc2-app-kit/Cargo.toml +++ b/framework-crates/objc2-app-kit/Cargo.toml @@ -20,13 +20,13 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_vendor = "apple")'.dependencies] objc2-cloud-kit = { path = "../objc2-cloud-kit", version = "0.2.2", default-features = false, optional = true } objc2-core-data = { path = "../objc2-core-data", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-image = { path = "../objc2-core-image", version = "0.2.2", default-features = false, optional = true } objc2-quartz-core = { path = "../objc2-quartz-core", version = "0.2.2", default-features = false, optional = true } objc2-uniform-type-identifiers = { path = "../objc2-uniform-type-identifiers", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-audio-toolbox/Cargo.toml b/framework-crates/objc2-audio-toolbox/Cargo.toml index 023652338..c07cc9972 100644 --- a/framework-crates/objc2-audio-toolbox/Cargo.toml +++ b/framework-crates/objc2-audio-toolbox/Cargo.toml @@ -20,8 +20,8 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-audio-types = { path = "../objc2-core-audio-types", version = "0.2.2", default-features = false, optional = true, features = ["CoreAudioBaseTypes"] } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["CFArray", "CFBase", "CFURL"] } +objc2-core-audio-types = { path = "../objc2-core-audio-types", version = "0.2.2", default-features = false, optional = true, features = ["CoreAudioBaseTypes", "objc2"] } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["CFArray", "CFBase", "CFURL", "objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-authentication-services/Cargo.toml b/framework-crates/objc2-authentication-services/Cargo.toml index 579c5c5ba..e8a007dd5 100644 --- a/framework-crates/objc2-authentication-services/Cargo.toml +++ b/framework-crates/objc2-authentication-services/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-automator/Cargo.toml b/framework-crates/objc2-automator/Cargo.toml index 2f3ef14ca..e49daa909 100644 --- a/framework-crates/objc2-automator/Cargo.toml +++ b/framework-crates/objc2-automator/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-app-kit = { path = "../objc2-app-kit", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-osa-kit = { path = "../objc2-osa-kit", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-av-foundation/Cargo.toml b/framework-crates/objc2-av-foundation/Cargo.toml index ad55decef..a244c7f77 100644 --- a/framework-crates/objc2-av-foundation/Cargo.toml +++ b/framework-crates/objc2-av-foundation/Cargo.toml @@ -20,10 +20,10 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-avf-audio = { path = "../objc2-avf-audio", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } -objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-uniform-type-identifiers = { path = "../objc2-uniform-type-identifiers", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-av-kit/Cargo.toml b/framework-crates/objc2-av-kit/Cargo.toml index 3c03c0bd6..5daea26ca 100644 --- a/framework-crates/objc2-av-kit/Cargo.toml +++ b/framework-crates/objc2-av-kit/Cargo.toml @@ -20,8 +20,8 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-av-foundation = { path = "../objc2-av-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-avf-audio/Cargo.toml b/framework-crates/objc2-avf-audio/Cargo.toml index 5ae8790e0..38c0c0fd6 100644 --- a/framework-crates/objc2-avf-audio/Cargo.toml +++ b/framework-crates/objc2-avf-audio/Cargo.toml @@ -19,8 +19,8 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-audio-types = { path = "../objc2-core-audio-types", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-audio-types = { path = "../objc2-core-audio-types", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(not(target_os = "watchos"))'.dependencies] diff --git a/framework-crates/objc2-business-chat/Cargo.toml b/framework-crates/objc2-business-chat/Cargo.toml index ef5329a98..51d971b74 100644 --- a/framework-crates/objc2-business-chat/Cargo.toml +++ b/framework-crates/objc2-business-chat/Cargo.toml @@ -17,7 +17,7 @@ workspace = true [dependencies] objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-class-kit/Cargo.toml b/framework-crates/objc2-class-kit/Cargo.toml index 983ed3da0..d3c2edd50 100644 --- a/framework-crates/objc2-class-kit/Cargo.toml +++ b/framework-crates/objc2-class-kit/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-contacts-ui/Cargo.toml b/framework-crates/objc2-contacts-ui/Cargo.toml index 18295aa0b..efb1f697f 100644 --- a/framework-crates/objc2-contacts-ui/Cargo.toml +++ b/framework-crates/objc2-contacts-ui/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-contacts = { path = "../objc2-contacts", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-core-audio-types/Cargo.toml b/framework-crates/objc2-core-audio-types/Cargo.toml index a523b4a62..73c2de794 100644 --- a/framework-crates/objc2-core-audio-types/Cargo.toml +++ b/framework-crates/objc2-core-audio-types/Cargo.toml @@ -17,7 +17,7 @@ workspace = true [dependencies] bitflags = { version = "2.5.0", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } [package.metadata.docs.rs] default-target = "aarch64-apple-darwin" @@ -35,9 +35,10 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "objc2/std"] -alloc = ["objc2/alloc"] +std = ["alloc", "bitflags?/std", "objc2?/std"] +alloc = ["objc2?/alloc"] bitflags = ["dep:bitflags"] +objc2 = ["dep:objc2"] AudioSessionTypes = [] CoreAudioBaseTypes = ["bitflags"] @@ -45,4 +46,5 @@ all = [ "AudioSessionTypes", "CoreAudioBaseTypes", "bitflags", + "objc2", ] diff --git a/framework-crates/objc2-core-audio-types/translation-config.toml b/framework-crates/objc2-core-audio-types/translation-config.toml index 9768df6d9..2e4514a05 100644 --- a/framework-crates/objc2-core-audio-types/translation-config.toml +++ b/framework-crates/objc2-core-audio-types/translation-config.toml @@ -1,6 +1,6 @@ framework = "CoreAudioTypes" crate = "objc2-core-audio-types" -required-crates = ["objc2"] # Temporary +required-crates = [] link = false # This framework only contains types custom-lib-rs = true macos = "10.15" diff --git a/framework-crates/objc2-core-bluetooth/Cargo.toml b/framework-crates/objc2-core-bluetooth/Cargo.toml index 8b467a9ac..a1ef3765d 100644 --- a/framework-crates/objc2-core-bluetooth/Cargo.toml +++ b/framework-crates/objc2-core-bluetooth/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] bitflags = { version = "2.5.0", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-core-foundation/Cargo.toml b/framework-crates/objc2-core-foundation/Cargo.toml index 44366207c..80f6d094d 100644 --- a/framework-crates/objc2-core-foundation/Cargo.toml +++ b/framework-crates/objc2-core-foundation/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } [package.metadata.docs.rs] default-target = "aarch64-apple-darwin" @@ -39,11 +39,12 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "block2?/std", "libc?/std", "objc2/std"] -alloc = ["block2?/alloc", "objc2/alloc"] +std = ["alloc", "bitflags?/std", "block2?/std", "libc?/std", "objc2?/std"] +alloc = ["block2?/alloc", "objc2?/alloc"] bitflags = ["dep:bitflags"] block2 = ["dep:block2"] libc = ["dep:libc"] +objc2 = ["dep:objc2"] CFArray = [] CFAttributedString = [] @@ -141,4 +142,5 @@ all = [ "bitflags", "block2", "libc", + "objc2", ] diff --git a/framework-crates/objc2-core-foundation/src/geometry.rs b/framework-crates/objc2-core-foundation/src/geometry.rs index aeb38f88b..821047436 100644 --- a/framework-crates/objc2-core-foundation/src/geometry.rs +++ b/framework-crates/objc2-core-foundation/src/geometry.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "objc2")] use objc2::encode::{Encode, Encoding, RefEncode}; use crate::{CGAffineTransform, CGVector}; @@ -25,6 +26,7 @@ pub type CGFloat = InnerFloat; not(target_vendor = "apple"), all(target_os = "macos", target_pointer_width = "32") )))] +#[cfg(feature = "objc2")] mod names { pub(super) const POINT: &str = "CGPoint"; pub(super) const SIZE: &str = "CGSize"; @@ -35,6 +37,7 @@ mod names { not(target_vendor = "apple"), all(target_os = "macos", target_pointer_width = "32") ))] +#[cfg(feature = "objc2")] mod names { pub(super) const POINT: &str = "_NSPoint"; pub(super) const SIZE: &str = "_NSSize"; @@ -53,11 +56,13 @@ pub struct CGPoint { pub y: CGFloat, } +#[cfg(feature = "objc2")] unsafe impl Encode for CGPoint { const ENCODING: Encoding = Encoding::Struct(names::POINT, &[CGFloat::ENCODING, CGFloat::ENCODING]); } +#[cfg(feature = "objc2")] unsafe impl RefEncode for CGPoint { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } @@ -111,11 +116,13 @@ pub struct CGSize { pub height: CGFloat, } +#[cfg(feature = "objc2")] unsafe impl Encode for CGSize { const ENCODING: Encoding = Encoding::Struct(names::SIZE, &[CGFloat::ENCODING, CGFloat::ENCODING]); } +#[cfg(feature = "objc2")] unsafe impl RefEncode for CGSize { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } @@ -203,11 +210,13 @@ pub struct CGRect { pub size: CGSize, } +#[cfg(feature = "objc2")] unsafe impl Encode for CGRect { const ENCODING: Encoding = Encoding::Struct(names::RECT, &[CGPoint::ENCODING, CGSize::ENCODING]); } +#[cfg(feature = "objc2")] unsafe impl RefEncode for CGRect { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } diff --git a/framework-crates/objc2-core-foundation/translation-config.toml b/framework-crates/objc2-core-foundation/translation-config.toml index 9a3b04eba..59df5fb43 100644 --- a/framework-crates/objc2-core-foundation/translation-config.toml +++ b/framework-crates/objc2-core-foundation/translation-config.toml @@ -1,6 +1,6 @@ framework = "CoreFoundation" crate = "objc2-core-foundation" -required-crates = ["objc2"] # Temporary +required-crates = [] custom-lib-rs = true macos = "10.0" maccatalyst = "13.0" diff --git a/framework-crates/objc2-core-graphics/Cargo.toml b/framework-crates/objc2-core-graphics/Cargo.toml index b905c7787..28c4c5987 100644 --- a/framework-crates/objc2-core-graphics/Cargo.toml +++ b/framework-crates/objc2-core-graphics/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } [target.'cfg(not(target_os = "watchos"))'.dependencies] @@ -42,11 +42,12 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "block2?/std", "libc?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-io-surface?/std", "objc2-metal?/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-io-surface?/alloc", "objc2-metal?/alloc"] +std = ["alloc", "bitflags?/std", "block2?/std", "libc?/std", "objc2?/std", "objc2-core-foundation?/std", "objc2-io-surface?/std", "objc2-metal?/std"] +alloc = ["block2?/alloc", "objc2?/alloc", "objc2-core-foundation?/alloc", "objc2-io-surface?/alloc", "objc2-metal?/alloc"] bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-io-surface?/bitflags", "objc2-metal?/bitflags"] block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-metal?/block2"] libc = ["dep:libc", "objc2-core-foundation?/libc", "objc2-io-surface?/libc"] +objc2 = ["dep:objc2", "objc2-core-foundation?/objc2", "objc2-io-surface?/objc2"] objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-io-surface?/objc2-core-foundation", "objc2-metal?/objc2-core-foundation"] objc2-io-surface = ["dep:objc2-io-surface", "objc2-metal?/objc2-io-surface"] objc2-metal = ["dep:objc2-metal"] @@ -266,6 +267,7 @@ all = [ "bitflags", "block2", "libc", + "objc2", "objc2-core-foundation", "objc2-io-surface", "objc2-metal", diff --git a/framework-crates/objc2-core-graphics/translation-config.toml b/framework-crates/objc2-core-graphics/translation-config.toml index c4d2eb40d..befdef52c 100644 --- a/framework-crates/objc2-core-graphics/translation-config.toml +++ b/framework-crates/objc2-core-graphics/translation-config.toml @@ -1,6 +1,6 @@ framework = "CoreGraphics" crate = "objc2-core-graphics" -required-crates = ["objc2"] # Temporary +required-crates = [] custom-lib-rs = true macos = "10.8" maccatalyst = "13.0" diff --git a/framework-crates/objc2-core-image/Cargo.toml b/framework-crates/objc2-core-image/Cargo.toml index de97b6ceb..492811adf 100644 --- a/framework-crates/objc2-core-image/Cargo.toml +++ b/framework-crates/objc2-core-image/Cargo.toml @@ -18,12 +18,12 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-ml = { path = "../objc2-core-ml", version = "0.2.2", default-features = false, optional = true } -objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } -objc2-io-surface = { path = "../objc2-io-surface", version = "0.2.2", default-features = false, optional = true } +objc2-io-surface = { path = "../objc2-io-surface", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false, optional = true } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-core-media/Cargo.toml b/framework-crates/objc2-core-media/Cargo.toml index b6c122320..208892bbd 100644 --- a/framework-crates/objc2-core-media/Cargo.toml +++ b/framework-crates/objc2-core-media/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } objc2-core-audio-types = { path = "../objc2-core-audio-types", version = "0.2.2", default-features = false, optional = true } objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } @@ -39,10 +39,11 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "block2?/std", "objc2/std", "objc2-core-audio-types?/std", "objc2-core-foundation?/std", "objc2-core-video?/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-audio-types?/alloc", "objc2-core-foundation?/alloc", "objc2-core-video?/alloc"] +std = ["alloc", "bitflags?/std", "block2?/std", "objc2?/std", "objc2-core-audio-types?/std", "objc2-core-foundation?/std", "objc2-core-video?/std"] +alloc = ["block2?/alloc", "objc2?/alloc", "objc2-core-audio-types?/alloc", "objc2-core-foundation?/alloc", "objc2-core-video?/alloc"] bitflags = ["dep:bitflags", "objc2-core-audio-types?/bitflags", "objc2-core-foundation?/bitflags", "objc2-core-video?/bitflags"] block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-video?/block2"] +objc2 = ["dep:objc2", "objc2-core-audio-types?/objc2", "objc2-core-foundation?/objc2", "objc2-core-video?/objc2"] objc2-core-audio-types = ["dep:objc2-core-audio-types"] objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-video?/objc2-core-foundation"] objc2-core-video = ["dep:objc2-core-video"] @@ -139,6 +140,7 @@ all = [ "CMTimeRange", "bitflags", "block2", + "objc2", "objc2-core-audio-types", "objc2-core-foundation", "objc2-core-video", diff --git a/framework-crates/objc2-core-media/translation-config.toml b/framework-crates/objc2-core-media/translation-config.toml index 5a5d5a0af..6f95c6294 100644 --- a/framework-crates/objc2-core-media/translation-config.toml +++ b/framework-crates/objc2-core-media/translation-config.toml @@ -1,6 +1,6 @@ framework = "CoreMedia" crate = "objc2-core-media" -required-crates = ["objc2"] # Temporary +required-crates = [] custom-lib-rs = true macos = "10.7" maccatalyst = "13.1" diff --git a/framework-crates/objc2-core-ml/Cargo.toml b/framework-crates/objc2-core-ml/Cargo.toml index 373e268d6..d2f531c68 100644 --- a/framework-crates/objc2-core-ml/Cargo.toml +++ b/framework-crates/objc2-core-ml/Cargo.toml @@ -19,8 +19,8 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } -objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(not(target_os = "watchos"))'.dependencies] diff --git a/framework-crates/objc2-core-text/Cargo.toml b/framework-crates/objc2-core-text/Cargo.toml index 09abee552..767b8d240 100644 --- a/framework-crates/objc2-core-text/Cargo.toml +++ b/framework-crates/objc2-core-text/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } @@ -39,11 +39,12 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "block2?/std", "libc?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-core-graphics?/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-core-graphics?/alloc"] +std = ["alloc", "bitflags?/std", "block2?/std", "libc?/std", "objc2?/std", "objc2-core-foundation?/std", "objc2-core-graphics?/std"] +alloc = ["block2?/alloc", "objc2?/alloc", "objc2-core-foundation?/alloc", "objc2-core-graphics?/alloc"] bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-core-graphics?/bitflags"] block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-graphics?/block2"] libc = ["dep:libc", "objc2-core-foundation?/libc", "objc2-core-graphics?/libc"] +objc2 = ["dep:objc2", "objc2-core-foundation?/objc2", "objc2-core-graphics?/objc2"] objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-graphics?/objc2-core-foundation"] objc2-core-graphics = ["dep:objc2-core-graphics"] @@ -177,6 +178,7 @@ all = [ "bitflags", "block2", "libc", + "objc2", "objc2-core-foundation", "objc2-core-graphics", ] diff --git a/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs b/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs index 943db5f02..64388f983 100644 --- a/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs +++ b/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs @@ -1,5 +1,6 @@ use core::{fmt, ptr}; +#[cfg(feature = "objc2")] use objc2::encode::{Encode, Encoding}; use crate::{ @@ -32,6 +33,7 @@ impl PartialEq for SFNTLookupFormatSpecificHeader { } } +#[cfg(feature = "objc2")] unsafe impl Encode for SFNTLookupFormatSpecificHeader { const ENCODING: Encoding = Encoding::Union( "SFNTLookupFormatSpecificHeader", diff --git a/framework-crates/objc2-core-text/translation-config.toml b/framework-crates/objc2-core-text/translation-config.toml index 96195a419..3b34d68ee 100644 --- a/framework-crates/objc2-core-text/translation-config.toml +++ b/framework-crates/objc2-core-text/translation-config.toml @@ -1,6 +1,6 @@ framework = "CoreText" crate = "objc2-core-text" -required-crates = ["objc2"] # Temporary +required-crates = [] custom-lib-rs = true macos = "10.8" maccatalyst = "13.0" diff --git a/framework-crates/objc2-core-video/Cargo.toml b/framework-crates/objc2-core-video/Cargo.toml index c79229b82..b063a9412 100644 --- a/framework-crates/objc2-core-video/Cargo.toml +++ b/framework-crates/objc2-core-video/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } @@ -42,10 +42,11 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "block2?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-core-graphics?/std", "objc2-io-surface?/std", "objc2-metal?/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-core-graphics?/alloc", "objc2-io-surface?/alloc", "objc2-metal?/alloc"] +std = ["alloc", "bitflags?/std", "block2?/std", "objc2?/std", "objc2-core-foundation?/std", "objc2-core-graphics?/std", "objc2-io-surface?/std", "objc2-metal?/std"] +alloc = ["block2?/alloc", "objc2?/alloc", "objc2-core-foundation?/alloc", "objc2-core-graphics?/alloc", "objc2-io-surface?/alloc", "objc2-metal?/alloc"] bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-core-graphics?/bitflags", "objc2-io-surface?/bitflags", "objc2-metal?/bitflags"] block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-graphics?/block2", "objc2-metal?/block2"] +objc2 = ["dep:objc2", "objc2-core-foundation?/objc2", "objc2-core-graphics?/objc2", "objc2-io-surface?/objc2"] objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-graphics?/objc2-core-foundation", "objc2-io-surface?/objc2-core-foundation", "objc2-metal?/objc2-core-foundation"] objc2-core-graphics = ["dep:objc2-core-graphics"] objc2-io-surface = ["dep:objc2-io-surface", "objc2-core-graphics?/objc2-io-surface", "objc2-metal?/objc2-io-surface"] @@ -146,6 +147,7 @@ all = [ "CVReturn", "bitflags", "block2", + "objc2", "objc2-core-foundation", "objc2-core-graphics", "objc2-io-surface", diff --git a/framework-crates/objc2-core-video/translation-config.toml b/framework-crates/objc2-core-video/translation-config.toml index a7ff551f1..10253d956 100644 --- a/framework-crates/objc2-core-video/translation-config.toml +++ b/framework-crates/objc2-core-video/translation-config.toml @@ -1,6 +1,6 @@ framework = "CoreVideo" crate = "objc2-core-video" -required-crates = ["objc2"] # Temporary +required-crates = [] custom-lib-rs = true macos = "10.4" maccatalyst = "13.0" diff --git a/framework-crates/objc2-core-wlan/Cargo.toml b/framework-crates/objc2-core-wlan/Cargo.toml index cd6fbaeb4..1d727591c 100644 --- a/framework-crates/objc2-core-wlan/Cargo.toml +++ b/framework-crates/objc2-core-wlan/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] bitflags = { version = "2.5.0", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-event-kit/Cargo.toml b/framework-crates/objc2-event-kit/Cargo.toml index eae7aae09..f9bc4a10f 100644 --- a/framework-crates/objc2-event-kit/Cargo.toml +++ b/framework-crates/objc2-event-kit/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-location = { path = "../objc2-core-location", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-map-kit = { path = "../objc2-map-kit", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-file-provider/Cargo.toml b/framework-crates/objc2-file-provider/Cargo.toml index 205b4630f..32c706cc5 100644 --- a/framework-crates/objc2-file-provider/Cargo.toml +++ b/framework-crates/objc2-file-provider/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-uniform-type-identifiers = { path = "../objc2-uniform-type-identifiers", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-foundation/Cargo.toml b/framework-crates/objc2-foundation/Cargo.toml index a6c21103c..8e9093227 100644 --- a/framework-crates/objc2-foundation/Cargo.toml +++ b/framework-crates/objc2-foundation/Cargo.toml @@ -20,7 +20,7 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } dispatch = { version = "0.2.0", optional = true } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-game-controller/Cargo.toml b/framework-crates/objc2-game-controller/Cargo.toml index f9231d6b3..82517285a 100644 --- a/framework-crates/objc2-game-controller/Cargo.toml +++ b/framework-crates/objc2-game-controller/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-game-kit/Cargo.toml b/framework-crates/objc2-game-kit/Cargo.toml index 029ef5139..002476a5e 100644 --- a/framework-crates/objc2-game-kit/Cargo.toml +++ b/framework-crates/objc2-game-kit/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-input-method-kit/Cargo.toml b/framework-crates/objc2-input-method-kit/Cargo.toml index b4eb33687..7bdc991e8 100644 --- a/framework-crates/objc2-input-method-kit/Cargo.toml +++ b/framework-crates/objc2-input-method-kit/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-app-kit = { path = "../objc2-app-kit", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-io-surface/Cargo.toml b/framework-crates/objc2-io-surface/Cargo.toml index a764e3ce5..f1b046c90 100644 --- a/framework-crates/objc2-io-surface/Cargo.toml +++ b/framework-crates/objc2-io-surface/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] bitflags = { version = "2.5.0", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } -objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true } objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false, optional = true } @@ -37,10 +37,11 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "libc?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-foundation?/std"] -alloc = ["objc2/alloc", "objc2-core-foundation?/alloc", "objc2-foundation?/alloc"] +std = ["alloc", "bitflags?/std", "libc?/std", "objc2?/std", "objc2-core-foundation?/std", "objc2-foundation?/std"] +alloc = ["objc2?/alloc", "objc2-core-foundation?/alloc", "objc2-foundation?/alloc"] bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-foundation?/bitflags"] libc = ["dep:libc", "objc2-core-foundation?/libc", "objc2-foundation?/libc"] +objc2 = ["dep:objc2", "objc2-core-foundation?/objc2"] objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-foundation?/objc2-core-foundation"] objc2-foundation = ["dep:objc2-foundation"] @@ -67,6 +68,7 @@ all = [ "ObjC", "bitflags", "libc", + "objc2", "objc2-core-foundation", "objc2-foundation", ] diff --git a/framework-crates/objc2-io-surface/translation-config.toml b/framework-crates/objc2-io-surface/translation-config.toml index 36eb35c83..1bde0b2d5 100644 --- a/framework-crates/objc2-io-surface/translation-config.toml +++ b/framework-crates/objc2-io-surface/translation-config.toml @@ -1,6 +1,6 @@ framework = "IOSurface" crate = "objc2-io-surface" -required-crates = ["objc2"] # Temporary +required-crates = [] custom-lib-rs = true macos = "10.6" maccatalyst = "13.0" diff --git a/framework-crates/objc2-link-presentation/Cargo.toml b/framework-crates/objc2-link-presentation/Cargo.toml index e43e4a2bd..eec92d1a7 100644 --- a/framework-crates/objc2-link-presentation/Cargo.toml +++ b/framework-crates/objc2-link-presentation/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-local-authentication-embedded-ui/Cargo.toml b/framework-crates/objc2-local-authentication-embedded-ui/Cargo.toml index 2ef90e894..f85b84ef4 100644 --- a/framework-crates/objc2-local-authentication-embedded-ui/Cargo.toml +++ b/framework-crates/objc2-local-authentication-embedded-ui/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-local-authentication = { path = "../objc2-local-authentication", version = "0.2.2", default-features = false } diff --git a/framework-crates/objc2-map-kit/Cargo.toml b/framework-crates/objc2-map-kit/Cargo.toml index 23c12062b..c2edb6996 100644 --- a/framework-crates/objc2-map-kit/Cargo.toml +++ b/framework-crates/objc2-map-kit/Cargo.toml @@ -19,8 +19,8 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-location = { path = "../objc2-core-location", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } diff --git a/framework-crates/objc2-media-player/Cargo.toml b/framework-crates/objc2-media-player/Cargo.toml index 30e56b110..1054cfea7 100644 --- a/framework-crates/objc2-media-player/Cargo.toml +++ b/framework-crates/objc2-media-player/Cargo.toml @@ -20,8 +20,8 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-av-foundation = { path = "../objc2-av-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-metal-kit/Cargo.toml b/framework-crates/objc2-metal-kit/Cargo.toml index ed4feb6f3..51c8cf77d 100644 --- a/framework-crates/objc2-metal-kit/Cargo.toml +++ b/framework-crates/objc2-metal-kit/Cargo.toml @@ -18,8 +18,8 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false } objc2-quartz-core = { path = "../objc2-quartz-core", version = "0.2.2", default-features = false, optional = true, features = ["objc2-metal"] } diff --git a/framework-crates/objc2-metal-performance-shaders/Cargo.toml b/framework-crates/objc2-metal-performance-shaders/Cargo.toml index 8371bced1..70ba61ed7 100644 --- a/framework-crates/objc2-metal-performance-shaders/Cargo.toml +++ b/framework-crates/objc2-metal-performance-shaders/Cargo.toml @@ -19,8 +19,8 @@ workspace = true bitflags = { version = "2.5.0", default-features = false } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false, features = ["MTLCommandBuffer", "MTLDevice"] } diff --git a/framework-crates/objc2-metal/Cargo.toml b/framework-crates/objc2-metal/Cargo.toml index 9fd5a36f4..fda2e1936 100644 --- a/framework-crates/objc2-metal/Cargo.toml +++ b/framework-crates/objc2-metal/Cargo.toml @@ -19,9 +19,9 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } -objc2-io-surface = { path = "../objc2-io-surface", version = "0.2.2", default-features = false, optional = true } +objc2-io-surface = { path = "../objc2-io-surface", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } [package.metadata.docs.rs] default-target = "aarch64-apple-darwin" diff --git a/framework-crates/objc2-open-directory/Cargo.toml b/framework-crates/objc2-open-directory/Cargo.toml index bdce263c6..9d9fcf941 100644 --- a/framework-crates/objc2-open-directory/Cargo.toml +++ b/framework-crates/objc2-open-directory/Cargo.toml @@ -17,7 +17,7 @@ workspace = true [dependencies] objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false, features = ["NSString"] } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-osa-kit/Cargo.toml b/framework-crates/objc2-osa-kit/Cargo.toml index 9c64bea19..8b107d1cf 100644 --- a/framework-crates/objc2-osa-kit/Cargo.toml +++ b/framework-crates/objc2-osa-kit/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-app-kit = { path = "../objc2-app-kit", version = "0.2.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-photos-ui/Cargo.toml b/framework-crates/objc2-photos-ui/Cargo.toml index e13078e80..f475e3d82 100644 --- a/framework-crates/objc2-photos-ui/Cargo.toml +++ b/framework-crates/objc2-photos-ui/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-location = { path = "../objc2-core-location", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-map-kit = { path = "../objc2-map-kit", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-photos/Cargo.toml b/framework-crates/objc2-photos/Cargo.toml index 6bec9e976..42dbbd766 100644 --- a/framework-crates/objc2-photos/Cargo.toml +++ b/framework-crates/objc2-photos/Cargo.toml @@ -20,10 +20,10 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-av-foundation = { path = "../objc2-av-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-image = { path = "../objc2-core-image", version = "0.2.2", default-features = false, optional = true } objc2-core-location = { path = "../objc2-core-location", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-uniform-type-identifiers = { path = "../objc2-uniform-type-identifiers", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-quartz-core/Cargo.toml b/framework-crates/objc2-quartz-core/Cargo.toml index 8e62984e1..4c4d3da4b 100644 --- a/framework-crates/objc2-quartz-core/Cargo.toml +++ b/framework-crates/objc2-quartz-core/Cargo.toml @@ -20,9 +20,9 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } libc = { version = "0.2.80", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } -objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-screen-capture-kit/Cargo.toml b/framework-crates/objc2-screen-capture-kit/Cargo.toml index 2dd912eca..2e9fcd415 100644 --- a/framework-crates/objc2-screen-capture-kit/Cargo.toml +++ b/framework-crates/objc2-screen-capture-kit/Cargo.toml @@ -21,9 +21,9 @@ block2 = { path = "../../crates/block2", version = "0.5.1", default-features = f libc = { version = "0.2.80", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-av-foundation = { path = "../objc2-av-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-screen-saver/Cargo.toml b/framework-crates/objc2-screen-saver/Cargo.toml index 551d7cd99..8e4975afa 100644 --- a/framework-crates/objc2-screen-saver/Cargo.toml +++ b/framework-crates/objc2-screen-saver/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-app-kit = { path = "../objc2-app-kit", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-sensitive-content-analysis/Cargo.toml b/framework-crates/objc2-sensitive-content-analysis/Cargo.toml index 5ee789087..59c8fdd4a 100644 --- a/framework-crates/objc2-sensitive-content-analysis/Cargo.toml +++ b/framework-crates/objc2-sensitive-content-analysis/Cargo.toml @@ -18,7 +18,7 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-sound-analysis/Cargo.toml b/framework-crates/objc2-sound-analysis/Cargo.toml index bdc15552d..c55e1369f 100644 --- a/framework-crates/objc2-sound-analysis/Cargo.toml +++ b/framework-crates/objc2-sound-analysis/Cargo.toml @@ -19,7 +19,7 @@ workspace = true block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-avf-audio = { path = "../objc2-avf-audio", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-ml = { path = "../objc2-core-ml", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } diff --git a/framework-crates/objc2-speech/Cargo.toml b/framework-crates/objc2-speech/Cargo.toml index 22765d7b4..e1b842ddf 100644 --- a/framework-crates/objc2-speech/Cargo.toml +++ b/framework-crates/objc2-speech/Cargo.toml @@ -19,7 +19,7 @@ workspace = true block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-avf-audio = { path = "../objc2-avf-audio", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-store-kit/Cargo.toml b/framework-crates/objc2-store-kit/Cargo.toml index c643a6fb7..191cece00 100644 --- a/framework-crates/objc2-store-kit/Cargo.toml +++ b/framework-crates/objc2-store-kit/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/framework-crates/objc2-ui-kit/Cargo.toml b/framework-crates/objc2-ui-kit/Cargo.toml index dc53cd585..aff665cb2 100644 --- a/framework-crates/objc2-ui-kit/Cargo.toml +++ b/framework-crates/objc2-ui-kit/Cargo.toml @@ -21,8 +21,8 @@ block2 = { path = "../../crates/block2", version = "0.5.1", default-features = f objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-cloud-kit = { path = "../objc2-cloud-kit", version = "0.2.2", default-features = false, optional = true } objc2-core-data = { path = "../objc2-core-data", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-location = { path = "../objc2-core-location", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-symbols = { path = "../objc2-symbols", version = "0.2.2", default-features = false, optional = true } diff --git a/framework-crates/objc2-virtualization/Cargo.toml b/framework-crates/objc2-virtualization/Cargo.toml index 23faae75c..ac675d4e9 100644 --- a/framework-crates/objc2-virtualization/Cargo.toml +++ b/framework-crates/objc2-virtualization/Cargo.toml @@ -20,7 +20,7 @@ bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-app-kit = { path = "../objc2-app-kit", version = "0.2.2", default-features = false, optional = true } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-vision/Cargo.toml b/framework-crates/objc2-vision/Cargo.toml index 92bbeef9f..85c75e923 100644 --- a/framework-crates/objc2-vision/Cargo.toml +++ b/framework-crates/objc2-vision/Cargo.toml @@ -18,12 +18,12 @@ workspace = true [dependencies] block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } -objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } +objc2-core-graphics = { path = "../objc2-core-graphics", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-image = { path = "../objc2-core-image", version = "0.2.2", default-features = false, optional = true } -objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true } +objc2-core-media = { path = "../objc2-core-media", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-core-ml = { path = "../objc2-core-ml", version = "0.2.2", default-features = false, optional = true } -objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] diff --git a/framework-crates/objc2-web-kit/Cargo.toml b/framework-crates/objc2-web-kit/Cargo.toml index be61b2a69..3c1a5645e 100644 --- a/framework-crates/objc2-web-kit/Cargo.toml +++ b/framework-crates/objc2-web-kit/Cargo.toml @@ -19,7 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } -objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true, features = ["objc2"] } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/generated b/generated index 0aa320324..82f7f3b1d 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit 0aa32032452bd792dd8aada609ea3a8fe0b67626 +Subproject commit 82f7f3b1d3746092c638bbe93ff9f10317a78130