From e83a97349f63ec19e85bd81996ae45c334a0d753 Mon Sep 17 00:00:00 2001 From: deep-soft Date: Fri, 1 Sep 2023 16:12:13 +0300 Subject: [PATCH] Update build.rs # if Runner.res not found compile icon.rc --- libs/portable/build.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/portable/build.rs b/libs/portable/build.rs index 2450e16cd..697af3d45 100644 --- a/libs/portable/build.rs +++ b/libs/portable/build.rs @@ -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), + } }