@@ -151,7 +151,6 @@ pub const EmsdkAllocator = enum {
151151pub const EmccDefaultSettingsOverrides = struct {
152152 optimize : std.builtin.OptimizeMode ,
153153 emsdk_allocator : EmsdkAllocator = .emmalloc ,
154- shell_file : ? []const u8 = null ,
155154};
156155
157156pub fn emccDefaultSettings (allocator : std.mem.Allocator , options : EmccDefaultSettingsOverrides ) EmccSettings {
@@ -182,6 +181,7 @@ pub const StepOptions = struct {
182181 embed_paths : ? []const EmccFilePath = null ,
183182 preload_paths : ? []const EmccFilePath = null ,
184183 shell_file_path : ? std.Build.LazyPath = null ,
184+ js_library_path : ? std.Build.LazyPath = null ,
185185 out_file_name : ? []const u8 = null ,
186186 install_dir : std.Build.InstallDir ,
187187};
@@ -227,13 +227,9 @@ pub fn emccStep(
227227 }
228228
229229 emcc .addArg ("-o" );
230- const out_file = out_file : {
231- if (options .out_file_name ) | out_file_name | {
232- break :out_file emcc .addOutputFileArg (out_file_name );
233- } else {
234- break :out_file emcc .addOutputFileArg (b .fmt ("{s}.html" , .{wasm .name }));
235- }
236- };
230+ const out_file = emcc .addOutputFileArg (
231+ options .out_file_name orelse b .fmt ("{s}.html" , .{wasm .name }),
232+ );
237233
238234 if (options .use_preload_plugins ) {
239235 emcc .addArg ("--use-preload-plugins" );
@@ -273,6 +269,12 @@ pub fn emccStep(
273269 emcc .addFileInput (shell_file_path );
274270 }
275271
272+ if (options .js_library_path ) | js_library_path | {
273+ emcc .addArg ("--js-library" );
274+ emcc .addFileArg (js_library_path );
275+ emcc .addFileInput (js_library_path );
276+ }
277+
276278 const install_step = b .addInstallDirectory (.{
277279 .source_dir = out_file .dirname (),
278280 .install_dir = options .install_dir ,
0 commit comments