diff --git a/build.zig b/build.zig index b514cbdce..9545c7d1e 100644 --- a/build.zig +++ b/build.zig @@ -261,9 +261,17 @@ pub fn build(b: *std.Build) !void { ); } - // Building with LTO on Windows is broken. - // https://github.com/ziglang/zig/issues/15958 - if (target.result.os.tag == .windows) exe.want_lto = false; + if (target.result.os.tag == .windows) { + exe.subsystem = .Windows; + exe.addWin32ResourceFile(.{ + .file = .{ .path = "dist/windows/ghostty.rc" }, + }); + + // Building with LTO on Windows is broken. + // https://github.com/ziglang/zig/issues/15958 + exe.want_lto = false; + } + // If we're installing, we get the install step so we can add // additional dependencies to it. diff --git a/dist/windows/ghostty.ico b/dist/windows/ghostty.ico new file mode 100644 index 000000000..1fe7ed98d Binary files /dev/null and b/dist/windows/ghostty.ico differ diff --git a/dist/windows/ghostty.manifest b/dist/windows/ghostty.manifest new file mode 100644 index 000000000..9a0790648 --- /dev/null +++ b/dist/windows/ghostty.manifest @@ -0,0 +1,14 @@ + + + + + true/pm + PerMonitorV2 + + + + + + + + diff --git a/dist/windows/ghostty.rc b/dist/windows/ghostty.rc new file mode 100644 index 000000000..0f3d12f87 --- /dev/null +++ b/dist/windows/ghostty.rc @@ -0,0 +1,36 @@ +// LANG_NEUTRAL(0), SUBLANG_NEUTRAL(0) +LANGUAGE 0, 0 + +#define RT_MANIFEST 1 +RT_MANIFEST 24 "ghostty.manifest" + +#define ID_ICON_GHOSTTY 1 +ID_ICON_GHOSTTY ICON "ghostty.ico" + +VS_VERSION_INFO VERSIONINFO +//FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_COMMIT_HEIGHT +//PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_COMMIT_HEIGHT +//FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +//FILEFLAGS VER_DBG +//FILEOS VOS_NT +//FILETYPE VFT_APP +//FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + //VALUE "CompanyName", "???" + //VALUE "FileDescription", "???" + //VALUE "FileVersion", VERSION + //VALUE "LegalCopyright", "(C) 2024 ???" + VALUE "OriginalFilename", "ghostty.exe" + VALUE "ProductName", "Ghostty" + //VALUE "ProductVersion", VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409,1200 + END +END