mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
integrate ada-url dependency to build system
This commit is contained in:
25
build.zig
25
build.zig
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user