aboutsummaryrefslogtreecommitdiff
path: root/azalea/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/build.rs')
-rw-r--r--azalea/build.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/azalea/build.rs b/azalea/build.rs
index faed1365..9dd6b738 100644
--- a/azalea/build.rs
+++ b/azalea/build.rs
@@ -1,6 +1,17 @@
use std::{env, process::Command};
fn main() {
+ check_nightly();
+
+ // save the optimization level, used by the pathfinder to warn if optimizations
+ // are off
+ println!(
+ "cargo::rustc-env=OPT_LEVEL={}",
+ env::var("OPT_LEVEL").unwrap()
+ );
+}
+
+fn check_nightly() {
// If using `rustup`, check the toolchain via `RUSTUP_TOOLCHAIN`
if let Ok(toolchain) = env::var("RUSTUP_TOOLCHAIN") {
if toolchain.contains("nightly") {