build: update for zig-0.13

This commit is contained in:
torque 2024-06-18 12:48:32 -07:00
parent a9f2298132
commit f431f7aa1c
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk
2 changed files with 5 additions and 4 deletions

View File

@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const yaml_zig = b.addModule("zaye", .{
.root_source_file = .{ .path = "src/zaye.zig" },
.root_source_file = b.path("src/zaye.zig"),
});
const libyaml = libyaml_build.libyamlLib(b, .{
@ -18,15 +18,16 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});
yaml_zig.linkLibrary(libyaml);
const example_step = b.step("example", "build example");
const ex_exe = b.addExecutable(.{
.name = "yamltest",
.root_source_file = .{ .path = "example/main.zig" },
.root_source_file = b.path("example/main.zig"),
.target = target,
.optimize = optimize,
});
ex_exe.linkLibrary(libyaml);
ex_exe.root_module.addImport("yaml", yaml_zig);
const install = b.addInstallArtifact(ex_exe, .{});

View File

@ -22,7 +22,7 @@ pub fn libyamlLib(
const cflags = [_][]const u8{};
lib.linkLibC();
lib.addIncludePath(.{ .path = include_prefix });
lib.addIncludePath(b.path(include_prefix));
lib.addCSourceFiles(.{ .files = &sources, .flags = &cflags });
lib.defineCMacro("YAML_VERSION_MAJOR", "0");
lib.defineCMacro("YAML_VERSION_MINOR", "2");