diff options
author | 2025-08-11 18:17:40 -0400 | |
---|---|---|
committer | 2025-08-11 20:46:00 -0400 | |
commit | 89055b019e2e2d49f8813d3578f6bc338326ca47 (patch) | |
tree | cdd097e134454937ccd35324b55d4055c2c2f4ed /build.zig | |
download | rt2-master.tar.gz rt2-master.zip |
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..f2ab70d --- /dev/null +++ b/build.zig @@ -0,0 +1,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}); + } +} |