Skip to content

Commit

Permalink
Add win resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerthox committed May 3, 2024
1 parent 0c60577 commit 700ee3b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
56 changes: 55 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ proc-macro2 = "1.0.59"
quote = "1.0.28"
serde = { version = "1.0.163", features = ["derive"] }
serde_yaml = "0.9.21"
winresource = "0.1.17"

[lib]
crate-type = ["cdylib"]

[package.metadata.winresource]
ProductName = "ArcDPS Buddy"
OriginalFilename = "arcdps_buddy.dll"

[profile.release]
lto = "thin"
10 changes: 9 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ use std::{
path::PathBuf,
};
use structs::SkillDef;
use winresource::WindowsResource;

fn main() {
let manifest = env::var_os("CARGO_MANIFEST_DIR").unwrap();
let out_dir = env::var_os("OUT_DIR").unwrap();
let in_dir = PathBuf::from(manifest).join("src/data/skills");
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();

if target_os == "windows" {
if let Err(err) = WindowsResource::new().compile() {
println!("cargo:warning=failed to compile windows resource: {err}");
}
}

let in_dir = PathBuf::from(manifest).join("src/data/skills");
let files = fs::read_dir(in_dir)
.unwrap()
.map(|entry| entry.unwrap().path())
Expand Down

0 comments on commit 700ee3b

Please sign in to comment.