Skip to content

Commit

Permalink
Merge pull request #38 from jyn514/compile-error
Browse files Browse the repository at this point in the history
Give a better error message when compiling on platforms other than Windows
  • Loading branch information
gentoo90 authored Dec 11, 2020
2 parents e57c297 + 6841063 commit 4c1de2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn main() {
if std::env::var("CARGO_CFG_WINDOWS").is_err() {
eprintln!("error: winreg is only supported on Windows platforms");
eprintln!(
"help: if your application is multi-platform, use \
`[target.'cfg(windows)'.dependencies] winreg = \"...\"`"
);
eprintln!("help: if your application is only supported on Windows, use `--target x86_64-pc-windows-gnu` or some other windows platform");
std::process::exit(1);
}
}

0 comments on commit 4c1de2c

Please sign in to comment.