floooh / sokol-zig

Zig bindings for the sokol headers (https://github.com/floooh/sokol)
zlib License
341 stars 46 forks source link

Update Readme for 0.11 #45

Closed Zettexe closed 1 year ago

Zettexe commented 1 year ago

The example for Use as Library should be updated as follows to work on Zig 0.11

const sokol = @import("lib/sokol-zig/build.zig");

// ...
// pub fn build(b: *std.build.Builder) void {
// ...

const sokol_build = sokol.buildSokol(b, target, optimize, .{}, "lib/sokol-zig/");

// ...
// const exe = b.addExecutable("demo", "src/main.zig");
// ...

exe.addAnonymousModule("sokol", .{ .source_file = .{ .path = "lib/sokol-zig/src/sokol/sokol.zig" } });
exe.linkLibrary(sokol_build);

exe.addPackagePath is now exe.addAnonymouseModule with a different input for the source file mode is now named optimize

floooh commented 1 year ago

Ok, fixed. Note though that those instruction will become obsolete once the package-branch is merged.