mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-25 02:27:00 -06:00
- assets/app-icon/: master and light SVGs, 1024 px PNG, .icns (Apple grid), .ico (16-256), hicolor 16-512 + scalable, LICENSE.txt, README with palette (#e0368f / #efe9dc / #0b0b0c), tile geometry and provenance; attribution sidecars + ATTRIBUTION.md rows. - packaging/icons.sh regenerates everything with resvg, iconutil and the new `cargo xtask ico`. - Runtime icon via ViewportBuilder::with_icon (padded variant on macOS) and Wayland app ID ai.storyteller.effectcraft; packaging/linux/ai.storyteller.effectcraft.desktop. - apps/effectcraft/build.rs embeds the .ico and VERSIONINFO into effectcraft.exe (winresource, Windows targets only; a missing resource compiler is a warning). - Web favicon.svg is now the unicorn icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.3 KiB
Rust
28 lines
1.3 KiB
Rust
//! Windows only: embed the app icon and version info (VERSIONINFO) into `effectcraft.exe`.
|
|
//!
|
|
//! On every other target this does nothing. A missing resource compiler is a warning, so a
|
|
//! cross-compile from macOS or Linux still links, unless `EFFECTCRAFT_REQUIRE_WINRES=1` turns it
|
|
//! into an error (for release builds).
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
println!("cargo:rerun-if-changed=../../assets/app-icon/effectcraft.ico");
|
|
println!("cargo:rerun-if-env-changed=EFFECTCRAFT_REQUIRE_WINRES");
|
|
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
|
|
return;
|
|
}
|
|
let mut res = winresource::WindowsResource::new();
|
|
res.set_icon("../../assets/app-icon/effectcraft.ico")
|
|
.set("ProductName", "EffectCraft")
|
|
.set("FileDescription", "EffectCraft motion graphics and visual effects")
|
|
.set("LegalCopyright", "Copyright (c) 2026 The EffectCraft contributors. MIT OR Apache-2.0.")
|
|
.set("OriginalFilename", "effectcraft.exe")
|
|
.set("InternalName", "effectcraft");
|
|
if let Err(e) = res.compile() {
|
|
if std::env::var_os("EFFECTCRAFT_REQUIRE_WINRES").is_some() {
|
|
panic!("embedding Windows resources failed: {e}");
|
|
}
|
|
println!("cargo:warning=effectcraft.exe built without icon/version resources: {e}");
|
|
}
|
|
}
|