-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use image::io::Reader as ImageReader; | ||
Check failure on line 1 in neothesia/build.rs
|
||
use std::{ | ||
env, | ||
fs::File, | ||
Check warning on line 4 in neothesia/build.rs
|
||
path::{Path, PathBuf}, | ||
}; | ||
|
||
fn main() { | ||
// #[cfg(target_os = "windows")] | ||
{ | ||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
let out_ico = out_dir.join("icon.ico"); | ||
let out_manifest = out_dir.join("manifest.rc"); | ||
|
||
let img = ImageReader::open("../flatpak/com.github.polymeilex.neothesia.png") | ||
.unwrap() | ||
.decode() | ||
.unwrap(); | ||
|
||
img.save(&out_ico); | ||
Check warning on line 20 in neothesia/build.rs
|
||
|
||
let manifest = "neothesia_icon ICON \"icon.ico\""; | ||
std::fs::write(&out_manifest, &manifest); | ||
Check warning on line 23 in neothesia/build.rs
|
||
|
||
embed_resource::compile(&out_manifest, embed_resource::NONE); | ||
Check failure on line 25 in neothesia/build.rs
|
||
} | ||
} |