Skip to content
Snippets Groups Projects
Verified Commit 710445dd authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: more env variable obtained

parent bebd1b15
No related branches found
No related tags found
No related merge requests found
Pipeline #2172 failed
......@@ -29,7 +29,7 @@ use std::fs::{File, OpenOptions};
use std::io::Write;
use std::path::Path;
use std::process::Command;
use std::str;
use std::{env, str};
const BUILD_OUT_FILE: &str = "build.rs";
const SOURCE_DIR: &str = "./src/gen";
......@@ -70,6 +70,12 @@ fn main() {
&format!("{}", now_utc.format("%H:%M:%S")),
);
write_str_constant(
&mut file,
"NAME",
option_env!("CARGO_PKG_NAME").unwrap_or("UNKNOWN"),
);
write_str_constant(
&mut file,
"VERSION",
......@@ -93,6 +99,30 @@ fn main() {
.as_str();
write_str_constant(&mut file, "COMPILER_VERSION", compiler_version);
write_str_constant(
&mut file,
"HOST",
&env::var("HOST").unwrap_or(String::from("UNKNOWN")),
);
write_str_constant(
&mut file,
"TARGET",
&env::var("TARGET").unwrap_or(String::from("UNKNOWN")),
);
write_str_constant(
&mut file,
"PROFILE",
&env::var("PROFILE").unwrap_or(String::from("UNKNOWN")),
);
write_str_constant(
&mut file,
"MAKEFLAGS",
option_env!("CARGO_MAKEFLAGS").unwrap_or("UNKNOWN"),
);
let mut features = vec!["cpu"];
if cfg!(feature = "wasm-extension") {
......
......@@ -2,9 +2,14 @@
pub const COMPILATION_DATE: &str = "-";
pub const COMPILATION_TIME: &str = "-";
pub const NAME: &str = "-";
pub const VERSION: &str = "x.x.x";
pub const COMPILER: &str = "rustc";
pub const COMPILER_VERSION: &str = "x.x.x";
pub const HOST: &str = "-";
pub const TARGET: &str = "-";
pub const PROFILE: &str = "-";
pub const MAKEFLAGS: &str = "-";
pub const FEATURES: [&str; 1] = ["cpu"];
pub const PLATFORM_CPU_BITS: &str = "64";
pub const DEFAULT_THREAD_POOL_SIZE: usize = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment