fb492d19eb
See #329 Supporting work: * move std.cstr.Buffer0 to std.buffer.Buffer * add build.zig to example/shared_library/ and add an automated test for it * add std.list.List.resizeDown * improve std.os.makePath - no longer recursive - takes into account . and .. * add std.os.path.isAbsolute * add std.os.path.resolve * reimplement std.os.path.dirname - no longer requires an allocator - handles edge cases correctly
21 lines
590 B
Zig
21 lines
590 B
Zig
const Builder = @import("std").build.Builder;
|
|
|
|
pub fn build(b: &Builder) {
|
|
const lib = b.addSharedLibrary("mathtest", "mathtest.zig", b.version(1, 0, 0));
|
|
|
|
const exe = b.addCExecutable("test");
|
|
exe.addCompileFlags([][]const u8 {
|
|
"-std=c99",
|
|
});
|
|
exe.addSourceFile("test.c");
|
|
exe.linkLibrary(lib);
|
|
|
|
b.default_step.dependOn(&exe.step);
|
|
|
|
const run_cmd = b.addCommand(b.out_dir, b.env_map, "./test", [][]const u8{});
|
|
run_cmd.step.dependOn(&exe.step);
|
|
|
|
const test_step = b.step("test", "Test the program");
|
|
test_step.dependOn(&run_cmd.step);
|
|
}
|