Browse Source

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

pull/3917/head
Dylan 8 months ago
committed by GitHub
parent
commit
583f81f458
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      src/build.zig

+ 9
- 5
src/build.zig View File

@ -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);
@ -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);
}

Loading…
Cancel
Save