const db = b.addModule("db", .{
.root_source_file = b.path("src/db.zig"),
+ .target = target,
+ .optimize = optimize,
});
db.addImport("lmdb", lmdb);
const lmdb_tests = b.addTest(.{
- .root_source_file = b.path("src/lmdb.zig"),
- .target = target,
- .optimize = optimize,
+ .root_module = lmdb,
});
lmdb_tests.addIncludePath(b.path("lmdb"));
- lmdb_tests.addCSourceFiles(.{ .files = &.{
- "./lmdb/midl.c",
- "./lmdb/mdb.c",
- } });
lmdb_tests.linkLibC();
const db_tests = b.addTest(.{
- .root_source_file = b.path("src/db.zig"),
- .target = target,
- .optimize = optimize,
+ .root_module = db,
});
db_tests.root_module.addImport("lmdb", lmdb);
test_step.dependOn(&db_tests.step);
test_step.dependOn(&lmdb_test_bin.step);
test_step.dependOn(&db_test_bin.step);
+
+ const check = b.step("check", "Check if ziglmdb compiles");
+ check.dependOn(&lmdb_tests.step);
+ check.dependOn(&db_tests.step);
}