1 const std = @import("std");
3 pub fn build(b: *std.Build) void {
4 const target = b.standardTargetOptions(.{});
6 const optimize = b.standardOptimizeOption(.{});
8 const exe = b.addExecutable(.{
10 // In this case the main source file is merely a path, however, in more
11 // complicated build scripts, this could be a generated file.
12 .root_source_file = .{ .cwd_relative = "src/main.zig" },
17 const lmdb_mod = b.createModule(.{
18 .root_source_file = .{ .cwd_relative = "../ziglmdb/src/lmdb.zig" },
20 lmdb_mod.addIncludePath(.{ .cwd_relative = "./lmdb/libraries/liblmdb" });
21 lmdb_mod.addCSourceFiles(.{ .files = &.{
22 "./lmdb/libraries/liblmdb/midl.c",
23 "./lmdb/libraries/liblmdb/mdb.c",
25 exe.root_module.addImport("lmdb", lmdb_mod);
29 b.installArtifact(exe);
31 const run_cmd = b.addRunArtifact(exe);
33 run_cmd.step.dependOn(b.getInstallStep());
36 run_cmd.addArgs(args);
39 const run_step = b.step("run", "Run the app");
40 run_step.dependOn(&run_cmd.step);