2018-09-06 21:29:35 +01:00
|
|
|
const Builder = @import("std").build.Builder;
|
|
|
|
|
|
|
|
pub fn build(b: *Builder) void {
|
|
|
|
const rel_opts = b.standardReleaseOptions();
|
2022-02-09 04:12:32 +00:00
|
|
|
const target = b.standardTargetOptions(.{});
|
2018-09-06 21:29:35 +01:00
|
|
|
|
2019-02-25 16:37:54 +00:00
|
|
|
const c_obj = b.addObject("cfuncs", null);
|
2019-11-30 04:04:19 +00:00
|
|
|
c_obj.addCSourceFile("cfuncs.c", &[_][]const u8{"-std=c99"});
|
2018-09-06 21:29:35 +01:00
|
|
|
c_obj.setBuildMode(rel_opts);
|
2019-02-25 16:37:54 +00:00
|
|
|
c_obj.linkSystemLibrary("c");
|
2022-02-09 04:12:32 +00:00
|
|
|
c_obj.target = target;
|
2018-09-06 21:29:35 +01:00
|
|
|
|
|
|
|
const main = b.addTest("main.zig");
|
|
|
|
main.setBuildMode(rel_opts);
|
|
|
|
main.addObject(c_obj);
|
2022-02-09 04:12:32 +00:00
|
|
|
main.target = target;
|
2018-09-06 21:29:35 +01:00
|
|
|
|
|
|
|
const test_step = b.step("test", "Test the program");
|
|
|
|
test_step.dependOn(&main.step);
|
|
|
|
|
|
|
|
b.default_step.dependOn(test_step);
|
|
|
|
}
|