Skip to content
Open
Changes from all 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
10 changes: 7 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
use std::env;

fn main() {
if cfg!(windows) {
if env::var("CARGO_CFG_WINDOWS").is_ok() {
// The first choice is Windows because DXGI is amazing.
println!("cargo:rustc-cfg=dxgi");
} else if cfg!(target_os="macos") {
} else if env::var("CARGO_CFG_TARGET_OS").unwrap() == "macos" {
// Quartz is second because macOS is the (annoying) exception.
println!("cargo:rustc-cfg=quartz");
} else if cfg!(unix) {
} else if env::var("CARGO_CFG_UNIX").is_ok() {
// On UNIX we pray that X11 (with XCB) is available.
println!("cargo:rustc-cfg=x11");
} else {
panic!("Platform not supported");
}
}