mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
Remove lib.zig
Signed-off-by: Not-Nik <nik.wipper@gmx.de>
This commit is contained in:
parent
edbd73e6be
commit
f661b47df7
59
lib.zig
59
lib.zig
@ -1,59 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
const Builder = std.build.Builder;
|
|
||||||
const LibExeObjStep = std.build.LibExeObjStep;
|
|
||||||
const rl = @import("raylib/src/build.zig");
|
|
||||||
|
|
||||||
const srcdir = getSrcDir();
|
|
||||||
|
|
||||||
fn getSrcDir() []const u8 {
|
|
||||||
return std.fs.path.dirname(@src().file) orelse ".";
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
|
||||||
.windows => {
|
|
||||||
exe.linkSystemLibrary("winmm");
|
|
||||||
exe.linkSystemLibrary("gdi32");
|
|
||||||
exe.linkSystemLibrary("opengl32");
|
|
||||||
},
|
|
||||||
.macos => {
|
|
||||||
exe.linkFramework("OpenGL");
|
|
||||||
exe.linkFramework("Cocoa");
|
|
||||||
exe.linkFramework("IOKit");
|
|
||||||
exe.linkFramework("CoreAudio");
|
|
||||||
exe.linkFramework("CoreVideo");
|
|
||||||
},
|
|
||||||
.freebsd, .openbsd, .netbsd, .dragonfly => {
|
|
||||||
exe.linkSystemLibrary("GL");
|
|
||||||
exe.linkSystemLibrary("rt");
|
|
||||||
exe.linkSystemLibrary("dl");
|
|
||||||
exe.linkSystemLibrary("m");
|
|
||||||
exe.linkSystemLibrary("X11");
|
|
||||||
exe.linkSystemLibrary("Xrandr");
|
|
||||||
exe.linkSystemLibrary("Xinerama");
|
|
||||||
exe.linkSystemLibrary("Xi");
|
|
||||||
exe.linkSystemLibrary("Xxf86vm");
|
|
||||||
exe.linkSystemLibrary("Xcursor");
|
|
||||||
},
|
|
||||||
else => { // linux and possibly others
|
|
||||||
exe.linkSystemLibrary("GL");
|
|
||||||
exe.linkSystemLibrary("rt");
|
|
||||||
exe.linkSystemLibrary("dl");
|
|
||||||
exe.linkSystemLibrary("m");
|
|
||||||
exe.linkSystemLibrary("X11");
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user