const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const exe_mod = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); const exe = b.addExecutable(.{ .name = "makko", .root_module = exe_mod, }); const koino_pkg = b.dependency("koino", .{ .optimize = .ReleaseFast, .target = target }); exe.root_module.addImport("koino", koino_pkg.module("koino")); const args_pkg = b.dependency("args", .{ .optimize = optimize, .target = target }); exe.root_module.addImport("args", args_pkg.module("args")); const mustache_pkg = b.dependency("mustache", .{ .optimize = .ReleaseSmall, .target = target }); exe.root_module.addImport("mustache", mustache_pkg.module("mustache")); const datetime_pkg = b.dependency("datetime", .{ .optimize = optimize, .target = target }); exe.root_module.addImport("datetime", datetime_pkg.module("datetime")); const httpz_pkg = b.dependency("httpz", .{ .target = target, .optimize = optimize }); exe.root_module.addImport("httpz", httpz_pkg.module("httpz")); const qrcode_pkg = b.dependency("qrcode", .{}); exe.root_module.addImport("qrcode", qrcode_pkg.module("qrcode")); // todo: replace with something zig-based const zigmon_pkg = b.dependency("zigmon", .{ .optimize = optimize, .target = target }); const zigmon_mod = zigmon_pkg.module("zigmon"); if (target.result.isDarwinLibC()) { if (b.lazyDependency("xcode_frameworks", .{})) |dep| { zigmon_mod.addSystemFrameworkPath(dep.path("Frameworks")); zigmon_mod.addSystemIncludePath(dep.path("include")); zigmon_mod.addLibraryPath(dep.path("lib")); } // TODO: push this to zigmon upstream zigmon_mod.linkFramework("CoreFoundation", .{ .weak = true }); zigmon_mod.linkFramework("CoreServices", .{ .weak = true }); } exe.root_module.addImport("zigmon", zigmon_mod); const setup_mod = b.createModule(.{ .root_source_file = b.path("build.zig.zon"), }); exe.root_module.addImport("build.zig.zon", setup_mod); b.installArtifact(exe); const run_cmd = b.addRunArtifact(exe); run_cmd.step.dependOn(b.getInstallStep()); if (b.args) |args| { run_cmd.addArgs(args); } const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); }