1
Fork 0
blog-zig-mongo/build.zig
Leonardo Devai 0f915a4e76 Add the devai.io boilerplate library: 42 runnable projects
21 bite-sized beginner tutorials (Web Basics, APIs & Data), the 8-backend blog
engine series, 4 blog frontends, 2 React starters, 3 NixOS desktops and 4 Rust
API/pipeline boilerplates. Every folder is a complete, self-contained project
with its own README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VGNxPf9PrSG2kzrxSvn45Y
2026-07-19 16:31:48 +02:00

25 lines
846 B
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
});
// System requirement: mongo-c-driver 1.x (found via pkg-config as
// libmongoc-1.0 / libbson-1.0). See README.
mod.linkSystemLibrary("mongoc-1.0", .{});
mod.linkSystemLibrary("bson-1.0", .{});
const exe = b.addExecutable(.{ .name = "blog", .root_module = mod });
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run the blog server");
run_step.dependOn(&run_cmd.step);
}