diff --git a/crates/header-translator/src/library.rs b/crates/header-translator/src/library.rs index c222720a0..0b396ccef 100644 --- a/crates/header-translator/src/library.rs +++ b/crates/header-translator/src/library.rs @@ -109,7 +109,7 @@ impl fmt::Display for Library { // FIXME: We always do cfg_attr(feature = "apple", ...) to make compiling things for GNUStep easier. writeln!( f, - "#[cfg_attr(feature = \"apple\", link(name = \"{}\", kind = \"framework\"))]", + "#[cfg_attr(all(feature = \"apple\", not(feature = \"unstable-no-link\")), link(name = \"{}\", kind = \"framework\"))]", self.link_name )?; if let Some(gnustep_library) = &self.data.gnustep_library { diff --git a/crates/icrate/Cargo.toml b/crates/icrate/Cargo.toml index c6aa28141..dbaf235c9 100644 --- a/crates/icrate/Cargo.toml +++ b/crates/icrate/Cargo.toml @@ -87,6 +87,9 @@ required-features = [ [features] default = ["std", "apple"] +# Disable to link frameworks, which may not available on lower OS versions, or users don't want to load the frameworks at startup (dyld). +unstable-no-link = [] + # Currently not possible to turn off, put here for forwards compatibility. std = ["alloc", "objc2?/std", "block2?/std"] alloc = ["objc2?/alloc", "block2?/alloc"]