const std = @import("std"); pub fn build(b: *std.Build) void { // for now, this only supports 32 bit windows builds, so just build for that // by default const target = b.standardTargetOptions(.{ .default_target = .{ .os_tag = .windows, .cpu_arch = .x86, .abi = .msvc, } }); const optimize = b.standardOptimizeOption(.{}); const hook = b.dependency("hook", .{}); const exe = b.addExecutable(.{ .name = "rt2", .root_module = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }), }); b.installArtifact(exe); exe.root_module.addImport("hook", hook.module("hook")); exe.linkSystemLibrary("kernel32"); exe.linkLibC(); exe.addIncludePath(b.path("../../../scoop/persist/vcpkg/installed/x86-windows-static/include")); const system_libraries = [_][]const u8 { "avcodec", "avutil", "avformat", "swscale", "vorbisfile", "libx264", "x265-static", "swresample", "ws2_32", "mfuuid", "strmiids", "ole32", "user32", "bcrypt", "secur32", "aom", "opus", "libmp3lame-static", "opus", "libmpghip-static", }; for (system_libraries) |library| { exe.linkSystemLibrary2(library, .{.preferred_link_mode = .static}); } }