Make fltk dependency optional on ui feature

This commit is contained in:
Philip Kristoffersen
2021-09-27 22:58:56 +02:00
parent 8434f7841f
commit ace806eb69
3 changed files with 25 additions and 14 deletions
+15 -6
View File
@@ -1,9 +1,18 @@
use std::path::PathBuf;
#[cfg(feature = "ui")]
use std::env;
#[cfg(feature = "ui")]
use std::path::PathBuf;
fn main() {
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!");
}
#[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!");
}
}