Skip to content

Commit

Permalink
Try to cleanup build.zig a bit
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Nov 3, 2024
1 parent f829167 commit 0537993
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Raylib.NET.Native/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,27 @@ pub fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize:
lib.installHeader(raygui.path("src/raygui.h"), "raygui.h");
lib.installHeader(rres.path("src/rres.h"), "rres.h");

// Idk why this is needed
// We need this to grab correct includes based on architecture
if (target.result.os.tag == .linux) {
if (target.result.cpu.arch == .aarch64) {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/aarch64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/aarch64-linux-gnu/" });
lib.addSystemIncludePath(.{ .cwd_relative = "/usr/include" });
} else {
} else if (target.result.cpu.arch == .x86) {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/i386-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/i386-linux-gnu/" });
lib.addSystemIncludePath(.{ .cwd_relative = "/usr/include" });
} else if (target.result.cpu.arch == .x86_64) {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/x86_64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include" });
} else {
lib.addSystemIncludePath(.{ .cwd_relative = "/usr/include" });
}

lib.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
}

lib.linkLibC();

return lib;
}

Expand Down

0 comments on commit 0537993

Please sign in to comment.