Skip to content

Commit

Permalink
Fix FileNotFound: .../src/raylib.h (#3915)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlangston authored Apr 13, 2024
1 parent ba2a103 commit 583f81f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ pub fn build(b: *std.Build) !void {

const lib = try addRaylib(b, target, optimize, options);

installHeaderVersioned(lib, "src/raylib.h", "raylib.h");
installHeaderVersioned(lib, "src/raymath.h", "raymath.h");
installHeaderVersioned(lib, "src/rlgl.h", "rlgl.h");
installHeaderVersioned(b, lib, "src/raylib.h", "raylib.h");
installHeaderVersioned(b, lib, "src/raymath.h", "raymath.h");
installHeaderVersioned(b, lib, "src/rlgl.h", "rlgl.h");

if (options.raygui) {
installHeaderVersioned(lib, "../raygui/src/raygui.h", "raygui.h");
installHeaderVersioned(b, lib, "../raygui/src/raygui.h", "raygui.h");
}

b.installArtifact(lib);
Expand Down Expand Up @@ -309,12 +309,16 @@ inline fn addCSourceFilesVersioned(
}

fn installHeaderVersioned(
b: *std.Build,
lib: *std.Build.Step.Compile,
source: []const u8,
dest: []const u8,
) void {
if (comptime builtin.zig_version.minor >= 12) {
lib.installHeader(.{ .path = source }, dest);
lib.installHeader(.{ .src_path = .{
.owner = b,
.sub_path = source,
} }, dest);
} else {
lib.installHeader(source, dest);
}
Expand Down

0 comments on commit 583f81f

Please sign in to comment.