zig/test/c_abi/build.zig

23 lines
652 B
Zig
Raw Normal View History

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();
const target = b.standardTargetOptions(.{});
2018-09-06 21:29:35 +01: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);
c_obj.linkSystemLibrary("c");
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);
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);
}