Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the codebase for latest zig and zld changes #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
const bld = @import("std").build;

fn addSokol(b: *bld.Builder, exe: *bld.LibExeObjStep) !void {
fn addSokol(exe: *bld.LibExeObjStep) !void {
exe.linkLibC();
if (exe.target.isDarwin()) {
b.env_map.put("ZIG_SYSTEM_LINKER_HACK", "1") catch unreachable;
exe.addCSourceFile("src/sokol/sokol.c", &[_][]const u8 { "-ObjC" });
exe.addCSourceFile("src/sokol/sokol.c", &[_][]const u8{"-ObjC"});
exe.linkFramework("MetalKit");
exe.linkFramework("Metal");
exe.linkFramework("Cocoa");
exe.linkFramework("QuartzCore");
exe.linkFramework("AudioToolbox");
}
else {
} else {
exe.addCSourceFile("src/sokol/sokol.c", &[_][]const u8{});
if (exe.target.isLinux()) {
exe.linkSystemLibrary("X11");
exe.linkSystemLibrary("Xi");
exe.linkSystemLibrary("Xcursor");
exe.linkSystemLibrary("GL");
exe.linkSystemLibrary("asound");
}
else if (exe.target.isWindows()) {
} else if (exe.target.isWindows()) {
exe.linkSystemLibrary("kernel32");
exe.linkSystemLibrary("user32");
exe.linkSystemLibrary("gdi32");
Expand All @@ -33,7 +30,7 @@ fn addSokol(b: *bld.Builder, exe: *bld.LibExeObjStep) !void {

pub fn build(b: *bld.Builder) void {
const exe = b.addExecutable("pacman", "src/pacman.zig");
addSokol(b, exe) catch unreachable;
addSokol(exe) catch unreachable;
exe.setBuildMode(b.standardReleaseOptions());
exe.addPackagePath("sokol", "src/sokol/sokol.zig");
exe.install();
Expand Down
Loading