summaryrefslogtreecommitdiff
path: root/build.zig
blob: 40cae2df1d729d1f9ec12ffba6cdb3578bb2ab6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const std = @import("std");

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

    const pkg = b.dependency("eostre", .{
        .target = target,
        .optimize = optimize,
    });

    const exe = b.addExecutable(.{
        .name = "shell",
        .root_source_file = b.path("src/main.zig"),
        .target = target,
        .optimize = optimize
    });

    const run_exe = b.addRunArtifact(exe);
    const run_step = b.step("run", "Run the application");
    run_step.dependOn(&run_exe.step);

    exe.root_module.addImport("eostre", pkg.module("eostre"));

    const test_step = b.step("test", "Run unit tests");

    const tests = b.addTest(.{
        .name = "shell",
        .root_source_file = b.path("src/main.zig"),
        .target = target,
    });
    tests.root_module.addImport("eostre", pkg.module("eostre"));

    const run_tests = b.addRunArtifact(tests);
    test_step.dependOn(&run_tests.step);

    const lib_tests = b.addRunArtifact(pkg.artifact("eostre"));
    test_step.dependOn(&lib_tests.step);
}