Bump to Zig 0.11/raylib 4.6-dev

This commit is contained in:
Not-Nik 2023-07-21 17:04:56 +02:00
parent 9c5197bad4
commit edbd73e6be
Failed to generate hash of commit
19 changed files with 478 additions and 402 deletions

11
lib.zig
View file

@ -3,20 +3,14 @@ const Builder = std.build.Builder;
const LibExeObjStep = std.build.LibExeObjStep;
const rl = @import("raylib/src/build.zig");
var ran_git = false;
const srcdir = getSrcDir();
fn getSrcDir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}
pub fn link(exe: *LibExeObjStep, system_lib: bool) void {
if (system_lib) {
exe.linkSystemLibrary("raylib");
return;
} else {
exe.linkLibrary(rl.addRaylib(exe.builder, exe.target));
}
pub fn link(exe: *std.Build.CompileStep) void {
exe.linkLibrary(rl.addRaylib(exe.builder, exe.target));
const target_os = exe.target.toTarget().os.tag;
switch (target_os) {
@ -57,6 +51,7 @@ pub fn link(exe: *LibExeObjStep, system_lib: bool) void {
pub fn addAsPackage(name: []const u8, to: *LibExeObjStep) void {
to.addPackagePath(name, srcdir ++ "/lib/raylib-zig.zig");
}
pub const math = struct {
pub fn addAsPackage(name: []const u8, to: *LibExeObjStep) void {
to.addPackagePath(name, srcdir ++ "/lib/raylib-zig-math.zig");