Skip to content

Commit

Permalink
build: update to latest Zig (#34)
Browse files Browse the repository at this point in the history
Update build.zig to work with Zig 0.13.0-dev.242+6635360db.
  • Loading branch information
theoparis authored May 22, 2024
1 parent 6cad40b commit 4bd71e1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn build(b: *Build) void {
const optimize = b.standardOptimizeOption(.{});

const xml = b.addModule("xml", .{
.root_source_file = .{ .path = "src/xml.zig" },
.root_source_file = b.path("src/xml.zig"),
});

addTests(b, target, optimize, xml);
Expand All @@ -18,7 +18,7 @@ pub fn build(b: *Build) void {

fn addTests(b: *Build, target: Build.ResolvedTarget, optimize: Mode, xml: *Build.Module) void {
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/xml.zig" },
.root_source_file = b.path("src/xml.zig"),
.target = target,
.optimize = optimize,
});
Expand All @@ -30,7 +30,7 @@ fn addTests(b: *Build, target: Build.ResolvedTarget, optimize: Mode, xml: *Build

const xmlconf_exe = b.addExecutable(.{
.name = "xmlconf",
.root_source_file = .{ .path = "test/xmlconf.zig" },
.root_source_file = b.path("test/xmlconf.zig"),
.target = target,
.optimize = optimize,
});
Expand Down Expand Up @@ -72,7 +72,7 @@ fn addTests(b: *Build, target: Build.ResolvedTarget, optimize: Mode, xml: *Build
fn addDocs(b: *Build, target: Build.ResolvedTarget) void {
const obj = b.addObject(.{
.name = "xml",
.root_source_file = .{ .path = "src/xml.zig" },
.root_source_file = b.path("src/xml.zig"),
.target = target,
.optimize = .Debug,
});
Expand All @@ -93,7 +93,7 @@ fn addExamples(b: *Build, target: Build.ResolvedTarget, optimize: Mode, xml: *Bu

const scan_exe = b.addExecutable(.{
.name = "scan",
.root_source_file = .{ .path = "examples/scan.zig" },
.root_source_file = b.path("examples/scan.zig"),
.target = target,
.optimize = optimize,
});
Expand All @@ -110,7 +110,7 @@ fn addExamples(b: *Build, target: Build.ResolvedTarget, optimize: Mode, xml: *Bu

const read_exe = b.addExecutable(.{
.name = "read",
.root_source_file = .{ .path = "examples/read.zig" },
.root_source_file = b.path("examples/read.zig"),
.target = target,
.optimize = optimize,
});
Expand All @@ -130,7 +130,7 @@ fn addFuzz(b: *Build, target: Build.ResolvedTarget, xml: *Build.Module) void {
// Thanks to https://www.ryanliptak.com/blog/fuzzing-zig-code/ for the basis of this!
const fuzz_lib = b.addStaticLibrary(.{
.name = "fuzz",
.root_source_file = .{ .path = "fuzz/main.zig" },
.root_source_file = b.path("fuzz/main.zig"),
.target = target,
.optimize = .Debug,
});
Expand Down Expand Up @@ -164,7 +164,7 @@ fn addFuzz(b: *Build, target: Build.ResolvedTarget, xml: *Build.Module) void {

const fuzz_reproduce_exe = b.addExecutable(.{
.name = "fuzz-reproduce",
.root_source_file = .{ .path = "fuzz/main.zig" },
.root_source_file = b.path("fuzz/main.zig"),
.target = target,
.optimize = .Debug,
});
Expand Down

0 comments on commit 4bd71e1

Please sign in to comment.