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:
+4
-5
@@ -4,7 +4,6 @@ version = "0.2.0"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
steam_shortcuts_util = "1.1.2"
|
steam_shortcuts_util = "1.1.2"
|
||||||
steamgriddb_api = "0.2,0"
|
steamgriddb_api = "0.2,0"
|
||||||
@@ -15,11 +14,11 @@ reqwest = { version = "0.11.4", features = ["default"] }
|
|||||||
config = "0.11.0"
|
config = "0.11.0"
|
||||||
failure = "0.1.8"
|
failure = "0.1.8"
|
||||||
#https://fltk-rs.github.io/fltk-rs/
|
#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]
|
[build-dependencies]
|
||||||
fl2rust = "0.4"
|
fl2rust = { version = "0.4", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
ui=[]
|
# default = ["ui"]
|
||||||
|
ui = ["fltk", "fl2rust"]
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
use std::path::PathBuf;
|
#[cfg(feature = "ui")]
|
||||||
use std::env;
|
use std::env;
|
||||||
|
#[cfg(feature = "ui")]
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
#[cfg(feature = "ui")]
|
||||||
|
{
|
||||||
println!("cargo:rerun-if-changed=gui/mainview.fl");
|
println!("cargo:rerun-if-changed=gui/mainview.fl");
|
||||||
let g = fl2rust::Generator::default();
|
let g = fl2rust::Generator::default();
|
||||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
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 settings;
|
||||||
mod steam;
|
mod steam;
|
||||||
mod steamgriddb;
|
mod steamgriddb;
|
||||||
|
#[cfg(feature = "ui")]
|
||||||
use fltk::{app, prelude::*, window::Window};
|
use fltk::{app, prelude::*, window::Window};
|
||||||
|
#[cfg(feature = "ui")]
|
||||||
mod mainview;
|
mod mainview;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -26,6 +28,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
let app = app::App::default().with_scheme(app::Scheme::Gtk);
|
let app = app::App::default().with_scheme(app::Scheme::Gtk);
|
||||||
let mut ui = mainview::UserInterface::make_window();
|
let mut ui = mainview::UserInterface::make_window();
|
||||||
|
|
||||||
|
|
||||||
app.run().unwrap();
|
app.run().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user