Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Alex-Beng/Yap
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Beng committed Mar 3, 2024
2 parents 3cff58c + 5bfc50d commit ddc9293
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ build = "build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.winres]
LegalCopyright = "Copyright Alex-Beng © 2024"
FileDescription = "Yap for Genshin"

[dependencies]
image = "0.24.6"
imageproc = "0.23.0"
Expand Down
20 changes: 11 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
extern crate winres;
use winres::VersionInfo;

fn main() {
// only run if target os is windows
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() != "windows" {
return;
}

// only build the resource for release builds
// as calling rc.exe might be slow
// if std::env::var("PROFILE").unwrap() == "release" {

let mut res = winres::WindowsResource::new();
// if cfg!(unix) {
// // paths for X64 on archlinux
Expand All @@ -19,12 +17,16 @@ fn main() {
// res.set_windres_path("/usr/bin/x86_64-w64-mingw32-windres");
// }

res
// .set_icon("icon.ico")
// can't use winapi crate constants for cross compiling
// MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US )
// .set_language(0x0409)
let mut version = 0 as u64;
version |= 0 << 48;
version |= 2 << 32;
version |= 2 << 16;
version |= 0;

res.set_version_info(VersionInfo::FILEVERSION, version)
.set_version_info(VersionInfo::PRODUCTVERSION, version)
.set_manifest_file("manifest.xml");

if let Err(e) = res.compile() {
eprintln!("{}", e);
std::process::exit(1);
Expand Down

0 comments on commit ddc9293

Please sign in to comment.