Fix FileNotFound: .../src/raylib.h (#3915)

This commit is contained in:
Dylan 2024-04-13 17:35:23 -04:00 committed by GitHub
parent ba2a103011
commit 583f81f458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 5 deletions

View File

@ -258,12 +258,12 @@ pub fn build(b: *std.Build) !void {
const lib = try addRaylib(b, target, optimize, options); const lib = try addRaylib(b, target, optimize, options);
installHeaderVersioned(lib, "src/raylib.h", "raylib.h"); installHeaderVersioned(b, lib, "src/raylib.h", "raylib.h");
installHeaderVersioned(lib, "src/raymath.h", "raymath.h"); installHeaderVersioned(b, lib, "src/raymath.h", "raymath.h");
installHeaderVersioned(lib, "src/rlgl.h", "rlgl.h"); installHeaderVersioned(b, lib, "src/rlgl.h", "rlgl.h");
if (options.raygui) { if (options.raygui) {
installHeaderVersioned(lib, "../raygui/src/raygui.h", "raygui.h"); installHeaderVersioned(b, lib, "../raygui/src/raygui.h", "raygui.h");
} }
b.installArtifact(lib); b.installArtifact(lib);
@ -309,12 +309,16 @@ inline fn addCSourceFilesVersioned(
} }
fn installHeaderVersioned( fn installHeaderVersioned(
b: *std.Build,
lib: *std.Build.Step.Compile, lib: *std.Build.Step.Compile,
source: []const u8, source: []const u8,
dest: []const u8, dest: []const u8,
) void { ) void {
if (comptime builtin.zig_version.minor >= 12) { if (comptime builtin.zig_version.minor >= 12) {
lib.installHeader(.{ .path = source }, dest); lib.installHeader(.{ .src_path = .{
.owner = b,
.sub_path = source,
} }, dest);
} else { } else {
lib.installHeader(source, dest); lib.installHeader(source, dest);
} }