Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const single_threaded = b.option(bool, "single-threaded", "Build in single threaded mode");
const linkage = b.option(std.builtin.LinkMode, "linkage", "Link mode") orelse .static;
const strip = b.option(bool, "strip", "Omit debug information");
const pic = b.option(bool, "pie", "Produce Position Independent Code");
Expand Down Expand Up @@ -55,7 +56,7 @@ pub fn build(b: *std.Build) !void {

var enable_windows_sspi = b.option(bool, "windows-sspi", "Enable SSPI on Windows (default: use-schannel)") orelse use_schannel;
const enable_ipv6 = b.option(bool, "enable-ipv6", "Enable IPv6 support (default: true)") orelse true;
const enable_threaded_resolver = dependentBoolOption(b, "threaded-resolver", "Enable threaded DNS lookup", true, !enable_ares, false);
const enable_threaded_resolver = dependentBoolOption(b, "threaded-resolver", "Enable threaded DNS lookup", true, !(single_threaded orelse false) and !enable_ares, false);
const enable_unicode = b.option(bool, "unicode", "Use the Unicode version of the Windows API functions (default: false)") orelse false;
const enable_unix_sockets = b.option(bool, "unix-sockets", "Enable Unix domain sockets support (default: true)") orelse true;
const ech = b.option(bool, "ech", "Enable ECH support (default: false)") orelse false;
Expand Down Expand Up @@ -133,6 +134,7 @@ pub fn build(b: *std.Build) !void {
.target = target,
.optimize = optimize,
.link_libc = true,
.single_threaded = single_threaded,
.strip = strip,
.pic = pic,
}),
Expand All @@ -153,6 +155,7 @@ pub fn build(b: *std.Build) !void {
.target = target,
.optimize = optimize,
.link_libc = true,
.single_threaded = single_threaded,
.strip = strip,
.pic = pic,
}),
Expand Down Expand Up @@ -326,6 +329,7 @@ pub fn build(b: *std.Build) !void {
if (b.lazyDependency("mbedtls", .{
.target = target,
.optimize = optimize,
.threading = !(single_threaded orelse false),
})) |dependency| {
curl.root_module.linkLibrary(dependency.artifact("mbedtls"));
// TODO infer the version
Expand Down Expand Up @@ -385,6 +389,7 @@ pub fn build(b: *std.Build) !void {
if (b.lazyDependency("zstd", .{
.target = target,
.optimize = optimize,
.@"multi-thread" = if (single_threaded orelse false) false else null,
})) |dependency| {
curl.root_module.linkLibrary(dependency.artifact("zstd"));
}
Expand Down Expand Up @@ -893,7 +898,7 @@ pub fn build(b: *std.Build) !void {
.PACKAGE_VERSION = b.fmt("{f}", .{version}),
.STDC_HEADERS = true,
.USE_ARES = enable_ares,
.USE_THREADS_POSIX = target.result.os.tag != .windows and !target.result.os.tag.isBSD(),
.USE_THREADS_POSIX = enable_threaded_resolver and target.result.os.tag != .windows and !target.result.os.tag.isBSD(),
.USE_THREADS_WIN32 = enable_threaded_resolver and target.result.os.tag == .windows,
.USE_GNUTLS = use_gnutls,
.USE_SSLS_EXPORT = use_ssls_export,
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
.lazy = true,
},
.mbedtls = .{
.url = "git+https://github.com/allyourcodebase/mbedtls.git#68d5872dca0faa3e2a09d3329c73bd8779cc34e6",
.hash = "mbedtls-3.6.4-E4NUR24VAADBF5pt-No-Z90DjozkzySYAgq6eDFy9Xdy",
.url = "git+https://github.com/allyourcodebase/mbedtls.git#3aa71a19acc173ae57b6a1114d62f2fdfd22960c",
.hash = "mbedtls-3.6.4-E4NUR2wWAAAUSvVbho9aaU31-e4D8glu9l1VfxKezBkV",
.lazy = true,
},
},
Expand Down