Skip to content

Commit

Permalink
Remove WINIT_LINK_COLORSYNC (no longer needed)
Browse files Browse the repository at this point in the history
Since rust-windowing#2078 we link to `ApplicationServices`, which contains the `CGDisplayCreateUUIDFromDisplayID` symbol in all versions.
  • Loading branch information
madsmtm committed Jan 5, 2022
1 parent 39dd30c commit 98e5c9e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# Unreleased

- Remove no longer needed `WINIT_LINK_COLORSYNC` environment variable.
- Fix linking to the `ColorSync` framework on macOS 10.7, and in newer Rust versions.
- On Web, implement cursor grabbing through the pointer lock API.
- On X11, add mappings for numpad comma, numpad enter, numlock and pause.
Expand Down
10 changes: 0 additions & 10 deletions README.md
Expand Up @@ -118,13 +118,3 @@ fn main() {
```

And run the application with `cargo apk run --example request_redraw_threaded`

#### MacOS

To ensure compatibility with older MacOS systems, winit links to
CGDisplayCreateUUIDFromDisplayID through the CoreGraphics framework.
However, under certain setups this function is only available to be linked
through the newer ColorSync framework. So, winit provides the
`WINIT_LINK_COLORSYNC` environment variable which can be set to `1` or `true`
while compiling to enable linking via ColorSync.

10 changes: 0 additions & 10 deletions build.rs

This file was deleted.

11 changes: 1 addition & 10 deletions src/platform_impl/macos/ffi.rs
Expand Up @@ -170,16 +170,7 @@ pub type CGDisplayModeRef = *mut c_void;
// 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 = "ApplicationServices", kind = "framework")
)]
#[cfg_attr(
use_colorsync_cgdisplaycreateuuidfromdisplayid,
link(name = "ColorSync", kind = "framework")
)]
#[link(name = "ApplicationServices", kind = "framework")]
extern "C" {
pub fn CGDisplayCreateUUIDFromDisplayID(display: CGDirectDisplayID) -> CFUUIDRef;
}
Expand Down

0 comments on commit 98e5c9e

Please sign in to comment.