···11+const std = @import("std");
22+33+// Although this function looks imperative, note that its job is to
44+// declaratively construct a build graph that will be executed by an external
55+// runner.
66+pub fn build(b: *std.Build) void {
77+ const target = b.standardTargetOptions(.{});
88+99+ const optimize = b.standardOptimizeOption(.{});
1010+1111+ _ = b.addModule("tmz", .{ .root_source_file = b.path("src/tmz.zig") });
1212+1313+ const lib_mod = b.createModule(.{
1414+ .root_source_file = b.path("src/tmz.zig"),
1515+ .target = target,
1616+ .optimize = optimize,
1717+ });
1818+1919+ const lib = b.addLibrary(.{
2020+ .linkage = .static,
2121+ .name = "tmz",
2222+ .root_module = lib_mod,
2323+ });
2424+2525+ b.installArtifact(lib);
2626+2727+ const unit_tests = b.addTest(.{
2828+ .root_module = lib_mod,
2929+ });
3030+3131+ const run_unit_tests = b.addRunArtifact(unit_tests);
3232+3333+ const test_step = b.step("test", "Run unit tests");
3434+ test_step.dependOn(&run_unit_tests.step);
3535+}
+30
build.zig.zon
···11+.{
22+ .name = .tmz,
33+44+ .version = "0.1.0",
55+66+ // Together with name, this represents a globally unique package
77+ // identifier. This field is generated by the Zig toolchain when the
88+ // package is first created, and then *never changes*. This allows
99+ // unambiguous detection of one package being an updated version of
1010+ // another.
1111+ //
1212+ // When forking a Zig project, this id should be regenerated (delete the
1313+ // field and run `zig build`) if the upstream project is still maintained.
1414+ // Otherwise, the fork is *hostile*, attempting to take control over the
1515+ // original project's identity. Thus it is recommended to leave the comment
1616+ // on the following line intact, so that it shows up in code reviews that
1717+ // modify the field.
1818+ .fingerprint = 0xcc3a94562c7802a6, // Changing this has security and trust implications
1919+2020+ .minimum_zig_version = "0.14.0",
2121+2222+ .dependencies = .{},
2323+2424+ .paths = .{
2525+ "build.zig",
2626+ "build.zig.zon",
2727+ "src",
2828+ "LICENSE",
2929+ },
3030+}