@@ -46,6 +46,8 @@ pub fn build(b: *Build) !void {
4646 b .option ([]const u8 , "git_commit" , "Current git commit" ) orelse "dev" ,
4747 );
4848
49+ const prebuilt_v8_path = b .option ([]const u8 , "prebuilt_v8_path" , "Path to prebuilt libc_v8.a" );
50+
4951 const target = b .standardTargetOptions (.{});
5052 const optimize = b .standardOptimizeOption (.{});
5153
@@ -59,7 +61,7 @@ pub fn build(b: *Build) !void {
5961 .link_libc = true ,
6062 .link_libcpp = true ,
6163 });
62- try addDependencies (b , lightpanda_module , opts );
64+ try addDependencies (b , lightpanda_module , opts , prebuilt_v8_path );
6365
6466 {
6567 // browser
@@ -113,7 +115,7 @@ pub fn build(b: *Build) !void {
113115 .target = target ,
114116 .optimize = optimize ,
115117 });
116- try addDependencies (b , wpt_module , opts );
118+ try addDependencies (b , wpt_module , opts , prebuilt_v8_path );
117119
118120 // compile and install
119121 const wpt = b .addExecutable (.{
@@ -133,14 +135,15 @@ pub fn build(b: *Build) !void {
133135 }
134136}
135137
136- fn addDependencies (b : * Build , mod : * Build.Module , opts : * Build.Step.Options ) ! void {
138+ fn addDependencies (b : * Build , mod : * Build.Module , opts : * Build.Step.Options , prebuilt_v8_path : ? [] const u8 ) ! void {
137139 try moduleNetSurf (b , mod );
138140 mod .addImport ("build_config" , opts .createModule ());
139141
140142 const target = mod .resolved_target .? ;
141143 const dep_opts = .{
142144 .target = target ,
143145 .optimize = mod .optimize .? ,
146+ .prebuilt_v8_path = prebuilt_v8_path ,
144147 };
145148
146149 mod .addIncludePath (b .path ("vendor/lightpanda" ));
@@ -153,15 +156,6 @@ fn addDependencies(b: *Build, mod: *Build.Module, opts: *Build.Step.Options) !vo
153156 const v8_mod = b .dependency ("v8" , dep_opts ).module ("v8" );
154157 v8_mod .addOptions ("default_exports" , v8_opts );
155158 mod .addImport ("v8" , v8_mod );
156-
157- switch (target .result .os .tag ) {
158- .macos = > {
159- // v8 has a dependency, abseil-cpp, which, on Mac, uses CoreFoundation
160- mod .addSystemFrameworkPath (.{ .cwd_relative = "/System/Library/Frameworks" });
161- mod .linkFramework ("CoreFoundation" , .{});
162- },
163- else = > {},
164- }
165159 }
166160
167161 {
0 commit comments