summaryrefslogtreecommitdiff
path: root/private/build.zig
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-02-23 03:51:28 +0100
committeraura <nw@moneybot.cc>2026-02-23 03:51:28 +0100
commitf251ddc8f0bba98a51be9b6e59ac4c5d9b24c3d5 (patch)
treee799284935a9012db280192375e9107575e2a216 /private/build.zig
parentbedf43af45d97a10a6f62b4f1bb21cd66fda1d71 (diff)
zig project startmaster
Diffstat (limited to 'private/build.zig')
-rw-r--r--private/build.zig40
1 files changed, 40 insertions, 0 deletions
diff --git a/private/build.zig b/private/build.zig
new file mode 100644
index 0000000..eae283b
--- /dev/null
+++ b/private/build.zig
@@ -0,0 +1,40 @@
+const z = @import( "std" );
+
+var b: *z.Build = undefined;
+var target: z.Build.ResolvedTarget = undefined;
+var optimize: z.builtin.OptimizeMode = undefined;
+
+fn import( name: []const u8 ) z.Build.Module.Import {
+ const i = b.dependency( name, .{ .target = target, .optimize = optimize } );
+ return .{ .name = name, .module = i.module( name ) };
+}
+
+pub fn build( _b: *z.Build ) void {
+ b = _b;
+ target = b.standardTargetOptions( .{} );
+ optimize = b.standardOptimizeOption( .{} );
+
+ const exe = b.addExecutable( .{
+ .name = "moneyboard-backend",
+ .root_module = b.createModule( .{
+ .root_source_file = b.path( "src/main.zig" ),
+ .target = target,
+ .optimize = optimize,
+ .imports = &.{
+ import( "sqlite" ),
+ },
+ } ),
+ } );
+
+ b.installArtifact( exe );
+
+ const run_step = b.step( "run", "Run the app" );
+ const run_cmd = b.addRunArtifact( exe );
+ run_step.dependOn( &run_cmd.step );
+
+ run_cmd.step.dependOn( b.getInstallStep() );
+
+ if( b.args ) |args| {
+ run_cmd.addArgs( args );
+ }
+}