diff --git a/CHANGELOG.md b/CHANGELOG.md index c47658b337..39eb9393ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - On X11, add mappings for numpad comma, numpad enter, numlock and pause. - On macOS, fix Pinyin IME input by reverting a change that intended to improve IME. +- Fix linking to the `ColorSync` framework on macOS 10.7, and in newer Rust versions. # 0.26.0 (2021-12-01) diff --git a/src/platform_impl/macos/ffi.rs b/src/platform_impl/macos/ffi.rs index bb5f26269a..1767c7eaf9 100644 --- a/src/platform_impl/macos/ffi.rs +++ b/src/platform_impl/macos/ffi.rs @@ -163,9 +163,18 @@ pub const IO8BitOverlayPixels: &str = "O8"; pub type CGWindowLevel = i32; pub type CGDisplayModeRef = *mut c_void; +// `CGDisplayCreateUUIDFromDisplayID` comes from the `ColorSync` framework. +// However, that framework was only introduced "publicly" in macOS 10.13. +// +// Since we want to support older versions, we can't link to `ColorSync` +// directly. Fortunately, it has always been available as a subframework of +// `ApplicationServices`, see: +// https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html#//apple_ref/doc/uid/TP40001067-CH210-BBCFFIEG +// +// TODO: Remove the WINIT_LINK_COLORSYNC hack, it is probably not needed. #[cfg_attr( not(use_colorsync_cgdisplaycreateuuidfromdisplayid), - link(name = "CoreGraphics", kind = "framework") + link(name = "ApplicationServices", kind = "framework") )] #[cfg_attr( use_colorsync_cgdisplaycreateuuidfromdisplayid,