Update build.rs

# if Runner.res not found compile icon.rc
This commit is contained in:
deep-soft 2023-09-01 16:12:13 +03:00 committed by GitHub
parent 6c5f0aecb4
commit e83a97349f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,10 @@
extern crate embed_resource;
use std::fs;
fn main() {
embed_resource::compile("icon.rc", embed_resource::NONE);
let runner_res_path = "./Runner.res";
match fs::metadata(runner_res_path) {
Ok(_) => println!("cargo:rustc-link-lib=dylib:+verbatim=./Runner.res"),
Err(_) => embed_resource::compile("icon.rc", embed_resource::NONE),
}
}