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
28 lines
984 B
Zig
28 lines
984 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const pg = b.dependency("pg", .{ .target = target, .optimize = optimize });
|
|
|
|
const mod = b.createModule(.{
|
|
.root_source_file = b.path("src/main.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "pg", .module = pg.module("pg") },
|
|
},
|
|
});
|
|
// Makes `@embedFile("schema.sql")` work from src/ even though the file
|
|
// lives at the repository root.
|
|
mod.addAnonymousImport("schema.sql", .{ .root_source_file = b.path("schema.sql") });
|
|
|
|
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);
|
|
}
|