mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Make fltk dependency optional on ui feature
This commit is contained in:
+7
-8
@@ -4,22 +4,21 @@ version = "0.2.0"
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
steam_shortcuts_util="1.1.2"
|
||||
steamgriddb_api="0.2,0"
|
||||
serde={version="1.0.130", features=["derive"]}
|
||||
steam_shortcuts_util = "1.1.2"
|
||||
steamgriddb_api = "0.2,0"
|
||||
serde = { version = "1.0.130", features = ["derive"] }
|
||||
serde_json = "1.0.68"
|
||||
tokio = { version = "1.11.0", features = ["full"] }
|
||||
reqwest = { version = "0.11.4", features = ["default"] }
|
||||
config = "0.11.0"
|
||||
failure = "0.1.8"
|
||||
#https://fltk-rs.github.io/fltk-rs/
|
||||
fltk = { version = "^1.2", features = ["fltk-bundled"] }
|
||||
|
||||
fltk = { version = "^1.2", features = ["fltk-bundled"], optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
fl2rust = "0.4"
|
||||
fl2rust = { version = "0.4", optional = true }
|
||||
|
||||
[features]
|
||||
ui=[]
|
||||
# default = ["ui"]
|
||||
ui = ["fltk", "fl2rust"]
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
use std::path::PathBuf;
|
||||
#[cfg(feature = "ui")]
|
||||
use std::env;
|
||||
#[cfg(feature = "ui")]
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
#[cfg(feature = "ui")]
|
||||
{
|
||||
println!("cargo:rerun-if-changed=gui/mainview.fl");
|
||||
let g = fl2rust::Generator::default();
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
g.in_out("gui/mainview.fl", out_path.join("mainview.rs").to_str().unwrap()).expect("Failed to generate rust from fl file!");
|
||||
g.in_out(
|
||||
"gui/mainview.fl",
|
||||
out_path.join("mainview.rs").to_str().unwrap(),
|
||||
)
|
||||
.expect("Failed to generate rust from fl file!");
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,9 @@ mod platform;
|
||||
mod settings;
|
||||
mod steam;
|
||||
mod steamgriddb;
|
||||
#[cfg(feature = "ui")]
|
||||
use fltk::{app, prelude::*, window::Window};
|
||||
#[cfg(feature = "ui")]
|
||||
mod mainview;
|
||||
|
||||
use crate::{
|
||||
@@ -26,6 +28,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
let app = app::App::default().with_scheme(app::Scheme::Gtk);
|
||||
let mut ui = mainview::UserInterface::make_window();
|
||||
|
||||
|
||||
app.run().unwrap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user