support mac and bsd
This commit is contained in:
parent
6ece4e99f0
commit
44fee6a550
1 changed files with 32 additions and 6 deletions
38
lib.zig
38
lib.zig
|
|
@ -11,12 +11,38 @@ pub fn Pkg(pkgdir: comptime []const u8) type {
|
||||||
"-D_POSIX_C_SOURCE",
|
"-D_POSIX_C_SOURCE",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (exe.target.toTarget().os.tag == .windows) {
|
switch (exe.target.toTarget().os.tag) {
|
||||||
exe.linkSystemLibrary("winmm");
|
.windows => {
|
||||||
exe.linkSystemLibrary("gdi32");
|
exe.linkSystemLibrary("winmm");
|
||||||
} else {
|
exe.linkSystemLibrary("gdi32");
|
||||||
exe.linkSystemLibrary("m");
|
exe.linkSystemLibrary("opengl32");
|
||||||
exe.linkSystemLibrary("X11");
|
},
|
||||||
|
.macosx => {
|
||||||
|
exe.linkFramework("OpenGL");
|
||||||
|
exe.linkFramework("Cocoa");
|
||||||
|
exe.linkFramework("IOKit");
|
||||||
|
exe.linkFramework("CoreAudio");
|
||||||
|
exe.linkFramework("CoreVideo");
|
||||||
|
},
|
||||||
|
.freebsd, .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");
|
||||||
|
},
|
||||||
}
|
}
|
||||||
exe.linkLibC();
|
exe.linkLibC();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue