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 ); } }