Merge pull request #21 from speedy-lex/main

linux to windows cross compile
This commit is contained in:
Quantum Tomato 2025-07-03 17:20:32 +02:00 committed by GitHub
commit 3be53f0e29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,8 +38,13 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, c: *std.Build.
c.addIncludePath(raylib.path(raylib.builder.h_dir));
c.linkLibrary(raylib.artifact("raylib"));
if (target.result.os.tag == .windows) {
c.linkSystemLibrary("WinMM");
c.linkSystemLibrary("GDI32");
if (builtin.os.tag != .windows) {
// cross compiling
c.addLibraryPath(.{ .cwd_relative = "/usr/x86_64-w64-mingw32/lib" });
c.addSystemIncludePath(.{ .cwd_relative = "/usr/x86_64-w64-mingw32/include" });
}
c.linkSystemLibrary("winmm");
c.linkSystemLibrary("gdi32");
}
}