File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use std::path::PathBuf;
77pub struct Config {
88 pub manifest_dir : PathBuf ,
99 pub out_dir : PathBuf ,
10- pub opt_level : u8 ,
10+ pub opt_level : String ,
1111 pub cargo_features : Vec < String > ,
1212 pub target_arch : String ,
1313 pub target_env : String ,
@@ -31,7 +31,7 @@ impl Config {
3131 Self {
3232 manifest_dir : PathBuf :: from ( env:: var ( "CARGO_MANIFEST_DIR" ) . unwrap ( ) ) ,
3333 out_dir : PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ,
34- opt_level : env:: var ( "OPT_LEVEL" ) . unwrap ( ) . parse ( ) . unwrap ( ) ,
34+ opt_level : env:: var ( "OPT_LEVEL" ) . unwrap ( ) ,
3535 cargo_features,
3636 target_arch : env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ,
3737 target_env : env:: var ( "CARGO_CFG_TARGET_ENV" ) . unwrap ( ) ,
@@ -91,7 +91,7 @@ fn emit_arch_cfg() {
9191fn emit_optimization_cfg ( cfg : & Config ) {
9292 println ! ( "cargo:rustc-check-cfg=cfg(optimizations_enabled)" ) ;
9393
94- if cfg. opt_level >= 2 {
94+ if ! matches ! ( cfg. opt_level. as_str ( ) , "0" | "1" ) {
9595 println ! ( "cargo:rustc-cfg=optimizations_enabled" ) ;
9696 }
9797}
You can’t perform that action at this time.
0 commit comments