Added features to control building with or without GUI, or use Edge engine on Windows.

This commit is contained in:
Revertron
2021-03-19 11:37:49 +01:00
parent 31bbb65ce9
commit 8a19d02b1a
2 changed files with 15 additions and 2 deletions
+6
View File
@@ -18,6 +18,7 @@ use winapi::um::wincon::{ATTACH_PARENT_PROCESS, AttachConsole, FreeConsole};
use alfis::{Block, Bytes, Chain, Miner, Context, Network, Settings, dns_utils, Keystore};
use alfis::blockchain::BLOCK_DIFFICULTY;
#[cfg(webui)]
mod web_ui;
const SETTINGS_FILENAME: &str = "alfis.toml";
@@ -37,6 +38,7 @@ fn main() {
let mut opts = Options::new();
opts.optflag("h", "help", "Print this help menu");
#[cfg(webui)]
opts.optflag("n", "nogui", "Run without graphic user interface");
opts.optflag("v", "verbose", "Show more debug messages");
opts.optflag("d", "debug", "Show trace messages, more than debug");
@@ -54,7 +56,10 @@ fn main() {
return;
}
#[cfg(webui)]
let no_gui = opt_matches.opt_present("n");
#[cfg(not(webui))]
let no_gui = true;
let mut level = LevelFilter::Info;
if opt_matches.opt_present("v") {
@@ -111,6 +116,7 @@ fn main() {
thread::sleep(sleep);
}
} else {
#[cfg(webui)]
web_ui::run_interface(context.clone(), miner.clone());
}