mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
b9307a9967
* 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
11 lines
464 B
Rust
11 lines
464 B
Rust
fn main() {
|
|
// If building for macos and WINIT_LINK_COLORSYNC is set to true
|
|
// use CGDisplayCreateUUIDFromDisplayID from ColorSync instead of CoreGraphics
|
|
if std::env::var("CARGO_CFG_TARGET_OS").map_or(false, |os| os == "macos")
|
|
&& std::env::var("WINIT_LINK_COLORSYNC")
|
|
.map_or(false, |v| v == "1" || v.eq_ignore_ascii_case("true"))
|
|
{
|
|
println!("cargo:rustc-cfg=use_colorsync_cgdisplaycreateuuidfromdisplayid");
|
|
}
|
|
}
|