From d96fd09fb721265373e5f48a7d017f776cea0415 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 28 Dec 2024 19:33:37 -0800 Subject: [PATCH] update to zig 0.13 --- .gitignore | 2 +- build.zig | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2b2d53252ccb4165d5a4f4c48046493b1544d398..755aa68f03a30361a954cb1bfbf823ba9fa604ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -zig-cache .zig-cache zig-out .zigmod deps.zig +files.zig zigmod.lock diff --git a/build.zig b/build.zig index d01f7ae18a3492f9036a53a724e61a488f23e562..c915a976e6e8b00f05b6d63ff7e17b0909540627 100644 --- a/build.zig +++ b/build.zig @@ -2,12 +2,18 @@ const std = @import("std"); const deps = @import("./deps.zig"); pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; + const t = b.addTest(.{ - .root_source_file = .{ .path = "main.zig" }, + .root_source_file = b.path("main.zig"), + .target = target, + .optimize = mode, }); deps.addAllTo(t); const run_t = b.addRunArtifact(t); + run_t.has_side_effects = true; const t_step = b.step("test", "Run all the tests."); t_step.dependOn(&run_t.step); -- 2.54.0