Add compile time feature compatibility check, remove from build.rs

This commit is contained in:
timvisee 2021-11-25 14:00:59 +01:00
parent 270362b152
commit 956c428251
No known key found for this signature in database
GPG Key ID: B8DB720BC383E172
2 changed files with 4 additions and 7 deletions

View File

@ -1,7 +0,0 @@
fn main() {
// Must enable rcon on Windows
#[cfg(all(windows, not(feature = "rcon")))]
{
println!("cargo:warning=lazymc: you must enable rcon feature on Windows");
}
}

View File

@ -31,6 +31,10 @@ use std::env;
use clap::App; use clap::App;
// Compile time feature compatability check.
#[cfg(all(windows, not(feature = "rcon")))]
compile_error!("Must enable \"rcon\" feature on Windows.");
/// Default log level if none is set. /// Default log level if none is set.
const LOG_DEFAULT: &str = "info"; const LOG_DEFAULT: &str = "info";