zig/test/standalone/c_embed_path/build.zig
2025-07-26 12:06:43 +02:00

27 lines
757 B
Zig

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);
}