~alva/zig-bare

bd62b90537753113f102da14be4af0b4270f9f5c — owl 11 months ago ba783ec
keep up with zig build system
2 files changed, 9 insertions(+), 10 deletions(-)

M build.zig
M build.zig.zon
M build.zig => build.zig +7 -8
@@ 2,20 2,19 @@ const builtin = @import("builtin");
const std = @import("std");
const mem = std.mem;
const fs = std.fs;
const Builder = std.build.Builder;
const Target = std.build.Target;
const program_name = "bare";
const sep = fs.path.sep_str;

pub fn build(b: *Builder) !void {
pub fn build(b: *std.Build) !void {
    const optimize = b.standardOptimizeOption(.{});
    const target = b.standardTargetOptions(.{});

    const varint_dep = b.dependency("varint", .{});

    const bare_mod = b.addModule("bare", .{
        .source_file = .{ .path = "src" ++ sep ++ "bare.zig" },
        .dependencies = &.{
        .root_source_file = .{ .path = "src" ++ sep ++ "bare.zig" },
        .imports = &.{
            .{
                .name = "varint",
                .module = varint_dep.module("varint"),


@@ 30,8 29,8 @@ pub fn build(b: *Builder) !void {
        .target = target,
    });

    bench.addModule("bare", bare_mod);
    bench.addModule("varint", varint_dep.module("varint"));
    bench.root_module.addImport("bare", bare_mod);
    bench.root_module.addImport("varint", varint_dep.module("varint"));

    const unit_tests = b.addTest(.{
        .root_source_file = .{ .path = "src" ++ sep ++ "test.zig" },


@@ 39,7 38,7 @@ pub fn build(b: *Builder) !void {
        .target = target,
    });

    unit_tests.addModule("bare", bare_mod);
    unit_tests.root_module.addImport("bare", bare_mod);

    const interop_tests = b.addTest(.{
        .root_source_file = .{ .path = "interop" ++ sep ++ "root.zig" },


@@ 47,7 46,7 @@ pub fn build(b: *Builder) !void {
        .target = target,
    });

    interop_tests.addModule("bare", bare_mod);
    interop_tests.root_module.addImport("bare", bare_mod);

    const bench_run_cmd = b.addRunArtifact(bench);
    const bench_run_step = b.step("bench", "Run " ++ program_name ++ " benchmarks");

M build.zig.zon => build.zig.zon +2 -2
@@ 4,8 4,8 @@
    .paths = .{""},
    .dependencies = .{
        .varint = .{
            .url = "https://git.sr.ht/~alva/zig-varint/archive/f9e5b7f.tar.gz",
            .hash = "1220136609b836df8ff707062b100395f49d6c87187c3e74312c223618ad69e9a9ab",
            .url = "https://git.sr.ht/~alva/zig-varint/archive/312fc43.tar.gz",
            .hash = "12206217b59bf0eac3652f2534c08b22aa9de3d8b62b3b155807625436add971f2d9",
        },
    },
}