aboutsummaryrefslogtreecommitdiff
path: root/test/standalone/c_embed_path/build.zig
blob: 246e18b3f0dec9a657ef98297f7a105cc1d8dd88 (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
const std = @import("std");

pub fn build(b: *std.Build) void {
    const test_step = b.step("test", "Test it");
    b.default_step = test_step;

    const optimize: std.builtin.OptimizeMode = .Debug;

    const exe = b.addExecutable(.{
        .name = "test",
        .root_module = b.createModule(.{
            .target = b.graph.host,
            .optimize = optimize,
        }),
    });
    exe.root_module.addCSourceFile(.{
        .file = b.path("test.c"),
        .flags = &.{"-std=c23"},
    });
    exe.root_module.link_libc = true;
    exe.root_module.addEmbedPath(b.path("data"));

    const run_c_cmd = b.addRunArtifact(exe);
    run_c_cmd.expectExitCode(0);
    run_c_cmd.skip_foreign_checks = true;
    test_step.dependOn(&run_c_cmd.step);
}