summaryrefslogtreecommitdiff
path: root/build.zig
blob: f2ab70dc6214fc000e5a945ab0b86b9fbd0adf76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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});
    }
}