Change linking of CGDisplayCreateUUIDFromDisplayID on macos (#1626)

* Link CGDisplayCreateUUIDFromDisplayID through ColorSync instead of CoreGraphics

* Conditionally link through ColorSync only if WINIT_LINK_COLORSYNC is set
to true

* Document new macos env var in README
This commit is contained in:
Imberflur
2021-02-05 02:58:55 -05:00
committed by GitHub
parent b1d353180b
commit b9307a9967
3 changed files with 32 additions and 1 deletions

View File

@@ -110,3 +110,13 @@ 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.