zaye/build.zig

36 lines
1.0 KiB
Zig
Raw Permalink Normal View History

// This file is licensed under the CC0 1.0 license.
// See: https://creativecommons.org/publicdomain/zero/1.0/legalcode
const std = @import("std");
const libyaml_build = @import("./libyaml.build.zig");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
2024-03-08 23:46:43 -08:00
const yaml_zig = b.addModule("zaye", .{
2024-06-18 12:48:32 -07:00
.root_source_file = b.path("src/zaye.zig"),
});
const libyaml = libyaml_build.libyamlLib(b, .{
.name = "libyaml",
.target = target,
.optimize = optimize,
});
2024-06-18 12:48:32 -07:00
yaml_zig.linkLibrary(libyaml);
const example_step = b.step("example", "build example");
const ex_exe = b.addExecutable(.{
.name = "yamltest",
2024-06-18 12:48:32 -07:00
.root_source_file = b.path("example/main.zig"),
.target = target,
.optimize = optimize,
});
2024-05-12 18:45:27 -07:00
ex_exe.root_module.addImport("yaml", yaml_zig);
const install = b.addInstallArtifact(ex_exe, .{});
example_step.dependOn(&install.step);
}