summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig39
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});
+ }
+}