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

pull/5/head
Revertron 3 years ago
parent 31bbb65ce9
commit 8a19d02b1a

@ -18,7 +18,6 @@ rust-crypto = "^0.2"
blakeout = "0.1.0"
num_cpus = "1.13.0"
byteorder = "1.3.2"
web-view = { version = "0.7.3", features = [] }
tinyfiledialogs = "3.3.10"
serde = { version = "1.0.123", features = ["derive"] }
serde_json = "1.0.42"
@ -34,6 +33,9 @@ mio = { version = "0.7", features = ["os-poll", "net"] }
# for DNS from hermes
derive_more = "0.99.9"
# Optional dependencies regulated by features
web-view = { version = "0.7.3", features = [], optional = true }
[target.'cfg(windows)'.dependencies]
thread-priority = "0.2.1"
winapi = { version = "0.3.7", features = ["impl-default", "wincon", "shellscalingapi"]}
@ -58,4 +60,9 @@ opt-level = 2
[package.metadata.winres]
ProductName="ALFIS"
FileDescription="Alternative Free Identity System"
FileDescription="Alternative Free Identity System"
[features]
webgui = ["web-view"]
edge = ["web-view/edge"]
default = ["webgui"]

@ -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());
}

Loading…
Cancel
Save