integrate ada-url dependency to build system

This commit is contained in:
nikneym
2025-10-02 18:23:30 +03:00
committed by Halil Durak
parent d87d782fd5
commit 25a1d588a9
2 changed files with 29 additions and 0 deletions

View File

@@ -384,6 +384,7 @@ fn addDependencies(b: *Build, mod: *Build.Module, opts: *Build.Step.Options) !vo
try buildMbedtls(b, mod);
try buildNghttp2(b, mod);
try buildCurl(b, mod);
try buildAda(b, mod);
switch (target.result.os.tag) {
.macos => {
@@ -849,3 +850,27 @@ fn buildCurl(b: *Build, m: *Build.Module) !void {
},
});
}
pub fn buildAda(b: *Build, m: *Build.Module) !void {
const ada_dep = b.dependency("ada-singleheader", .{});
const ada = b.addLibrary(.{
.name = "ada",
.linkage = .static,
.root_module = b.createModule(.{
.target = m.resolved_target,
.optimize = m.optimize,
.link_libcpp = true,
}),
});
// Expose "ada_c.h".
ada.installHeader(ada_dep.path("ada_c.h"), "ada_c.h");
ada.root_module.addCSourceFiles(.{
.root = ada_dep.path(""),
.files = &.{"ada.cpp"},
.flags = &.{"-std=c++20"},
});
m.linkLibrary(ada);
}

View File

@@ -9,5 +9,9 @@
.hash = "v8-0.0.0-xddH63bVAwBSEobaUok9J0er1FqsvEujCDDVy6ItqKQ5",
},
//.v8 = .{ .path = "../zig-v8-fork" }
.@"ada-singleheader" = .{
.url = "https://github.com/ada-url/ada/releases/download/v3.3.0/singleheader.zip",
.hash = "N-V-__8AAPmhFAAw64ALjlzd5YMtzpSrmZ6KymsT84BKfB4s",
},
},
}