Skip to content

Commit

Permalink
feat: add executable icon
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Noah committed Jul 17, 2024
1 parent fe9362a commit 853c319
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.afdesign filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
24 changes: 24 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#[cfg(target_os = "windows")]
pub fn add_resource(name: String) {
let out_dir = std::env::var("OUT_DIR").expect("No OUT_DIR env var");

if !std::process::Command::new("rc.exe")
.args(["/fo", &format!("{}/{}.lib", &out_dir, &name), "/I", &out_dir, &(name.to_owned() + &String::from(".rc"))])
.status()
.expect("Could not find rc.exe")
.success()
{
panic!("Failed to build resource file");
}

println!("cargo:rustc-link-search=native={}", &out_dir);
println!("cargo:rustc-link-lib=dylib={}", &name);
}

#[cfg(target_os = "windows")]
fn main() {
add_resource(String::from("resources"));
}

#[cfg(not(target_os = "windows"))]
fn main() {}
3 changes: 3 additions & 0 deletions icon.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions logo.afdesign
Git LFS file not shown
3 changes: 3 additions & 0 deletions logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources.rc
Binary file not shown.

0 comments on commit 853c319

Please sign in to comment.