summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig55
1 files changed, 1 insertions, 54 deletions
diff --git a/build.zig b/build.zig
index ec1e6402..a5ae2dee 100644
--- a/build.zig
+++ b/build.zig
@@ -40,7 +40,6 @@ const PerfBuild = struct {
mupdf: bool,
jpx: bool,
tracy: bool,
- quic: bool,
theme_animation: bool,
terminal_simd: bool,
prebuilt_shaders: bool,
@@ -118,10 +117,6 @@ pub fn build(b: *std.Build) void {
const is_web = platform == .web;
const is_esp32p4 = platform == .esp32p4;
const freestanding_core = is_web or is_esp32p4;
- const enable_quic = b.option(bool, "quic", "optional 9P-over-QUIC transport using system OpenSSL 3.6+ (default off)") orelse false;
- if (enable_quic and freestanding_core) @panic("-Dquic=true needs a native platform");
- const ninep_options = b.addOptions();
- ninep_options.addOption(bool, "quic", enable_quic);
const enable_mupdf = b.option(bool, "mupdf", "native PDF rendering with MuPDF (AGPL/commercial; native default on, web/esp32p4 off; -Dmupdf=false disables)") orelse !freestanding_core;
const enable_jpx = b.option(bool, "jpx", "JPEG 2000 in PDFs, for scanned documents (default on; -Djpx=false drops openjpeg)") orelse true;
// Off on the board too: the sources are ~1.8 MB, more than the whole
@@ -295,37 +290,6 @@ pub fn build(b: *std.Build) void {
const cloud9 = b.dependency("cloud9", .{ .target = target, .optimize = optimize }).module("cloud9");
for (core_mods) |mod| mod.addImport("cloud9", cloud9);
const core_shells = core_shells_buf[0..core_mods_len];
- for (core_mods) |mod| mod.addOptions("9p_options", ninep_options);
- const quic_test_step = b.step("quic-test", "test optional QUIC transport (-Dquic=true)");
- if (enable_quic) {
- const header = b.addWriteFiles().add("openssl.h", "#include <openssl/ssl.h>\n#include <openssl/quic.h>\n#include <openssl/err.h>\n");
- const translated = b.addTranslateC(.{ .root_source_file = header, .target = target, .optimize = optimize, .link_libc = true });
- const include_dir = std.mem.trim(u8, b.run(&.{ "pkg-config", "--variable=includedir", "openssl" }), " \t\r\n");
- if (include_dir.len == 0) @panic("OpenSSL pkg-config metadata is missing its include directory");
- translated.addSystemIncludePath(.{ .cwd_relative = include_dir });
- const openssl = translated.createModule();
- const library_dir = std.mem.trim(u8, b.run(&.{ "pkg-config", "--variable=libdir", "openssl" }), " \t\r\n");
- if (library_dir.len == 0) @panic("OpenSSL pkg-config metadata is missing its library directory");
- openssl.addLibraryPath(.{ .cwd_relative = library_dir });
- openssl.linkSystemLibrary("ssl", .{});
- openssl.linkSystemLibrary("crypto", .{});
- for (core_mods) |mod| mod.addImport("openssl", openssl);
- const quic_module = b.createModule(.{
- .target = target,
- .optimize = optimize,
- .root_source_file = b.path("src/9p_quic.zig"),
- .link_libc = true,
- });
- quic_module.addImport("openssl", openssl);
- quic_module.addImport("cloud9", cloud9);
- const tests = b.addTest(.{ .root_module = quic_module, .filters = test_filters });
- if (test_nonce) |nonce| tests.root_module.addImport("test_rebuild_nonce", nonce);
- test_build.dependOn(&tests.step);
- const run_tests = b.addRunArtifact(tests);
- run_tests.has_side_effects = true;
- quic_test_step.dependOn(&run_tests.step);
- if (testMatch(b, unit_profile, test_filters, quic_test_step)) |check| check.addArtifactArg(tests);
- } else quic_test_step.dependOn(&b.addFail("quic-test needs -Dquic=true and system OpenSSL 3.6+").step);
// The conditional dependencies, hoisted so one `wireCore` call at the end
// can name them all. The unconditional ones are ordinary consts below.
@@ -1232,10 +1196,6 @@ pub fn build(b: *std.Build) void {
}) |src|
link.addFileArg(b.path(b.fmt("src/macos/Sources/{s}", .{src})));
link.addFileArg(lib_archive);
- if (enable_quic) {
- const ssl_libdir = std.mem.trim(u8, b.run(&.{ "pkg-config", "--variable=libdir", "openssl" }), " \t\r\n");
- link.addArgs(&.{ "-L", ssl_libdir, "-lssl", "-lcrypto" });
- }
link.addArgs(&.{
"-lc++",
"-framework",
@@ -1322,10 +1282,6 @@ pub fn build(b: *std.Build) void {
"test/macos_e2e.swift",
}) |source| e2e.addFileArg(b.path(source));
e2e.addFileArg(lib_archive);
- if (enable_quic) {
- const ssl_libdir = std.mem.trim(u8, b.run(&.{ "pkg-config", "--variable=libdir", "openssl" }), " \t\r\n");
- e2e.addArgs(&.{ "-L", ssl_libdir, "-lssl", "-lcrypto" });
- }
e2e.addArgs(&.{ "-lc++", "-framework", "AppKit", "-framework", "CoreText", "-framework", "CoreGraphics", "-framework", "CoreImage", "-framework", "Metal" });
const files = b.addWriteFiles();
const runnable = files.addCopyFile(e2e_bin, "pardes-macos-e2e");
@@ -1586,7 +1542,6 @@ pub fn build(b: *std.Build) void {
.mupdf = enable_mupdf,
.jpx = enable_mupdf and enable_jpx,
.tracy = tracy != null,
- .quic = enable_quic,
.theme_animation = theme_animation orelse (platform != .esp32p4),
.terminal_simd = ghostty_simd,
.prebuilt_shaders = platform == .gui and prebuilt_shaders,
@@ -1871,13 +1826,9 @@ pub fn build(b: *std.Build) void {
ninep_io_module.link_objects.appendSlice(b.allocator, core_module.link_objects.items) catch @panic("OOM");
var ninep_imports = core_module.import_table.iterator();
while (ninep_imports.next()) |entry| ninep_io_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
- if (enable_quic) {
- ninep_io_module.linkSystemLibrary("ssl", .{});
- ninep_io_module.linkSystemLibrary("crypto", .{});
- }
const ninep_io_tests = b.addTest(.{
.root_module = ninep_io_module,
- .filters = &.{ "Unix TCP", "one fetch", "expired sessions", "posts itself" },
+ .filters = &.{ "Unix and TCP", "one fetch", "expired sessions", "posts itself" },
});
b.step("9p-io-test", "run native 9P transport and client integration tests")
.dependOn(&b.addRunArtifact(ninep_io_tests).step);
@@ -1891,10 +1842,6 @@ pub fn build(b: *std.Build) void {
fs_module.link_objects.appendSlice(b.allocator, core_module.link_objects.items) catch @panic("OOM");
var fs_imports = core_module.import_table.iterator();
while (fs_imports.next()) |entry| fs_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
- if (enable_quic) {
- fs_module.linkSystemLibrary("ssl", .{});
- fs_module.linkSystemLibrary("crypto", .{});
- }
const fs_tests = b.addTest(.{ .root_module = fs_module, .filters = test_filters });
b.step("fs-unit-test", "run filesystem unit tests").dependOn(&b.addRunArtifact(fs_tests).step);