mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			306 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			306 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use std::env;
 | |
| 
 | |
| fn main() {
 | |
|     let opt_level = env::var("OPT_LEVEL")
 | |
|         .ok()
 | |
|         .and_then(|s| s.parse().ok())
 | |
|         .unwrap_or(0);
 | |
|     let profile = env::var("PROFILE").unwrap_or_default();
 | |
|     if profile == "release" || opt_level >= 2 {
 | |
|         println!("cargo:rustc-cfg=optimized");
 | |
|     }
 | |
| }
 | 
