build: update for zig-0.13
This commit is contained in:
parent
a9f2298132
commit
f431f7aa1c
@ -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, .{});
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user