Skip to content

Commit 49fc0cd

Browse files
fix: remove broken b.findProgram call, keep simple MSYS2 fallback paths
1 parent 57c23e5 commit 49fc0cd

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

build.zig

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,25 +101,13 @@ pub fn build(b: *std.Build) void {
101101
// Windows-specific: hide terminal window, add MSYS2 search paths
102102
if (target.result.os.tag == .windows) {
103103
exe.subsystem = .Windows;
104-
// Try to find MSYS2 pkg-config in project cache or system paths
105-
const search_in = [_][]const u8{
106-
".\\cache\\msys64\\ucrt64\\bin",
107-
"C:\\msys64\\ucrt64\\bin",
108-
"C:\\msys64\\mingw64\\bin",
104+
// Add common MSYS2 lib directories for Zig linker to find
105+
const msys_libs = [_][]const u8{
106+
".\\cache\\msys64\\ucrt64\\lib",
107+
"C:\\msys64\\ucrt64\\lib",
108+
"C:\\msys64\\mingw64\\lib",
109109
};
110-
const pkg_config = b.findProgram(&.{"pkg-config"}, &search_in) catch null;
111-
if (pkg_config) |pc| {
112-
// pkg-config resolves everything — no extra paths needed
113-
_ = pc;
114-
} else {
115-
// Fallback: add common MSYS2 lib directories
116-
const fallback = [_][]const u8{
117-
".\\cache\\msys64\\ucrt64\\lib",
118-
"C:\\msys64\\ucrt64\\lib",
119-
"C:\\msys64\\mingw64\\lib",
120-
};
121-
for (fallback) |p| exe.root_module.addLibraryPath(.{ .cwd_relative = p });
122-
}
110+
for (msys_libs) |p| exe.root_module.addLibraryPath(.{ .cwd_relative = p });
123111
}
124112

125113
// macOS .app bundle (only on macOS)

0 commit comments

Comments
 (0)