Skip to content

Commit 1bd658f

Browse files
committed
Fix win32, mac build bugs in build.zig
1 parent d1e55ae commit 1bd658f

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

build.zig

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn linkWindows(mod: *std.Build.Module, opengl: bool, comptime lshcore: bool)
8888
if (opengl) mod.linkSystemLibrary("opengl32", .{});
8989
mod.linkSystemLibrary("winmm", .{});
9090
mod.linkSystemLibrary("gdi32", .{});
91-
if (lshcore) mod.linkSystemLibrary("lshcore", .{});
91+
if (lshcore) mod.linkSystemLibrary("shcore", .{});
9292
}
9393

9494
fn findWaylandScanner(b: *std.Build) void {
@@ -122,13 +122,8 @@ pub fn linkLinux(mod: *std.Build.Module, comptime display_backend: LinuxDisplayB
122122
}
123123
}
124124

125-
pub fn linkBSD(b: *std.Build, mod: *std.Build.Module) void {
125+
pub fn linkBSD(_: *std.Build, mod: *std.Build.Module) void {
126126
mod.linkSystemLibrary("GL", .{});
127-
128-
mod.addSystemIncludePath(b.path("/usr/local/include/"));
129-
mod.addSystemIncludePath(b.path("/usr/pkg/include"));
130-
mod.addSystemIncludePath(b.path("/usr/X11R7/include"));
131-
mod.addRPath(b.path("/usr/pkg/lib"));
132127
}
133128

134129
pub fn linkMacOS(b: *std.Build, mod: *std.Build.Module) void {
@@ -392,8 +387,6 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
392387

393388
try raylib_flags_arr.append("-Werror=implicit-function-declaration");
394389

395-
raylib_mod.addSystemIncludePath(b.path("/usr/include/libdrm"));
396-
397390
raylib_mod.linkSystemLibrary("libdrm", .{ .use_pkg_config = .force });
398391
raylib_mod.linkSystemLibrary("drm", .{});
399392
raylib_mod.linkSystemLibrary("gbm", .{});
@@ -693,6 +686,8 @@ fn addExamples(
693686
exe_mod.addIncludePath(b.path("src/external/glfw/include"));
694687
}
695688
if (std.mem.eql(u8, filename, "raylib_opengl_interop")) {
689+
if (platform == .drm) continue;
690+
if (target.result.os.tag == .macos) continue;
696691
exe_mod.addIncludePath(b.path("src/external"));
697692
}
698693

@@ -707,7 +702,7 @@ fn addExamples(
707702
.root_module = exe_mod,
708703
});
709704

710-
const install_dir: std.Build.InstallDir = .{ .custom = "web" };
705+
const install_dir: std.Build.InstallDir = .{ .custom = b.fmt("web/{s}/{s}", .{ module, filename }) };
711706
const emcc_flags = emsdk.emccDefaultFlags(b.allocator, .{ .optimize = optimize });
712707
const emcc_settings = emsdk.emccDefaultSettings(b.allocator, .{ .optimize = optimize });
713708

@@ -740,7 +735,7 @@ fn addExamples(
740735
});
741736
b.installArtifact(exe);
742737

743-
const install_cmd = b.addInstallArtifact(exe, .{});
738+
const install_cmd = b.addInstallArtifact(exe, .{ .dest_sub_path = b.fmt("{s}/{s}", .{ module, filename }) });
744739

745740
const run_cmd = b.addRunArtifact(exe);
746741
run_cmd.cwd = b.path(module_subpath);

build.zig.zon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
.zemscripten = .{
2424
.url = "git+https://github.com/zig-gamedev/zemscripten#3fa4b778852226c7346bdcc3c1486e875a9a6d02",
2525
.hash = "zemscripten-0.2.0-dev-sRlDqApRAACspTbAZnuNKWIzfWzSYgYkb2nWAXZ-tqqt",
26-
.lazy = true,
2726
},
2827
},
2928

0 commit comments

Comments
 (0)