Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unstable-no-link feature #525

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 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
1 change: 1 addition & 0 deletions crates/block-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![allow(clippy::negative_feature_names)]
#![allow(non_camel_case_types)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/block-sys/0.2.0")]
Expand Down
1 change: 1 addition & 0 deletions crates/block2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![allow(clippy::negative_feature_names)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/block2/0.3.0")]

Expand Down
2 changes: 1 addition & 1 deletion crates/header-translator/src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \"no-link-{0}\")), link(name = \"{0}\", kind = \"framework\"))]",
self.link_name
)?;
if let Some(gnustep_library) = &self.data.gnustep_library {
Expand Down
41 changes: 41 additions & 0 deletions crates/icrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,47 @@ required-features = [
[features]
default = ["std", "apple"]

# Disable to link specific frameworks, which may not available on lower OS versions, or users don't want to load the frameworks at startup (dyld).
xiaopengli89 marked this conversation as resolved.
Show resolved Hide resolved
no-link-Accessibility = []
no-link-AdServices = []
no-link-AdSupport = []
no-link-AutomaticAssessmentConfiguration = []
no-link-AuthenticationServices = []
no-link-BackgroundAssets = []
no-link-BackgroundTasks = []
no-link-BusinessChat = []
no-link-CallKit = []
no-link-ClassKit = []
no-link-CloudKit = []
no-link-Contacts = []
no-link-DataDetection = []
no-link-DeviceCheck = []
no-link-EventKit = []
no-link-ExtensionKit = []
no-link-ExternalAccessory = []
no-link-FileProvider = []
no-link-FileProviderUI = []
no-link-GameController = []
no-link-GameKit = []
no-link-HealthKit = []
no-link-IdentityLookup = []
no-link-LocalAuthentication = []
no-link-LocalAuthenticationEmbeddedUI = []
no-link-LinkPresentation = []
no-link-MailKit = []
no-link-MapKit = []
no-link-MediaPlayer = []
no-link-Metal = []
no-link-MetalKit = []
no-link-MetalFX = []
no-link-MetricKit = []
no-link-OSAKit = []
no-link-PhotoKit = []
no-link-SoundAnalysis = []
no-link-Speech = []
no-link-UniformTypeIdentifiers = []
no-link-UserNotifications = []

# Currently not possible to turn off, put here for forwards compatibility.
std = ["alloc", "objc2?/std", "block2?/std"]
alloc = ["objc2?/alloc", "block2?/alloc"]
Expand Down
1 change: 1 addition & 0 deletions crates/icrate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
#![allow(clippy::type_complexity)]
#![allow(clippy::identity_op)]
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::negative_feature_names)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/icrate/0.0.4")]
#![recursion_limit = "512"]
Expand Down
1 change: 1 addition & 0 deletions crates/objc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::negative_feature_names)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
Expand Down
1 change: 1 addition & 0 deletions crates/objc2-encode/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![allow(clippy::negative_feature_names)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2-encode/3.0.0")]
#![cfg_attr(feature = "unstable-c-unwind", feature(c_unwind))]
Expand Down
1 change: 1 addition & 0 deletions crates/objc2-proc-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![allow(clippy::negative_feature_names)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2-proc-macros/0.1.1")]

Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![allow(clippy::negative_feature_names)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2/0.4.1")]

Expand Down
Loading