@@ -105,10 +105,12 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
105
105
106
106
pub const EmccFlags = std .StringHashMap (void );
107
107
108
- pub fn emccDefaultFlags ( allocator : std.mem.Allocator , options : struct {
108
+ pub const EmccDefaultFlagsOverrides = struct {
109
109
optimize : std.builtin.OptimizeMode ,
110
110
fsanitize : bool ,
111
- }) EmccFlags {
111
+ };
112
+
113
+ pub fn emccDefaultFlags (allocator : std.mem.Allocator , options : EmccDefaultFlagsOverrides ) EmccFlags {
112
114
var args = EmccFlags .init (allocator );
113
115
switch (options .optimize ) {
114
116
.Debug = > {
@@ -136,22 +138,23 @@ pub fn emccDefaultFlags(allocator: std.mem.Allocator, options: struct {
136
138
137
139
pub const EmccSettings = std .StringHashMap ([]const u8 );
138
140
139
- pub fn emccDefaultSettings (
140
- allocator : std.mem.Allocator ,
141
- options : struct {
142
- optimize : std.builtin.OptimizeMode ,
143
- emsdk_allocator : enum {
144
- none ,
145
- dlmalloc ,
146
- emmalloc ,
147
- @"emmalloc-debug" ,
148
- @"emmalloc-memvalidate" ,
149
- @"emmalloc-verbose" ,
150
- mimalloc ,
151
- } = .emmalloc ,
152
- shell_file : ? []const u8 = null ,
153
- },
154
- ) EmccSettings {
141
+ pub const EmsdkAllocator = enum {
142
+ none ,
143
+ dlmalloc ,
144
+ emmalloc ,
145
+ @"emmalloc-debug" ,
146
+ @"emmalloc-memvalidate" ,
147
+ @"emmalloc-verbose" ,
148
+ mimalloc ,
149
+ };
150
+
151
+ pub const EmccDefaultSettingsOverrides = struct {
152
+ optimize : std.builtin.OptimizeMode ,
153
+ emsdk_allocator : EmsdkAllocator = .emmalloc ,
154
+ shell_file : ? []const u8 = null ,
155
+ };
156
+
157
+ pub fn emccDefaultSettings (allocator : std.mem.Allocator , options : EmccDefaultSettingsOverrides ) EmccSettings {
155
158
var settings = EmccSettings .init (allocator );
156
159
switch (options .optimize ) {
157
160
.Debug , .ReleaseSafe = > {
@@ -171,9 +174,21 @@ pub const EmccFilePath = struct {
171
174
virtual_path : ? []const u8 = null ,
172
175
};
173
176
177
+ pub const StepOptions = struct {
178
+ optimize : std.builtin.OptimizeMode ,
179
+ flags : EmccFlags ,
180
+ settings : EmccSettings ,
181
+ use_preload_plugins : bool = false ,
182
+ embed_paths : ? []const EmccFilePath = null ,
183
+ preload_paths : ? []const EmccFilePath = null ,
184
+ shell_file_path : ? std.Build.LazyPath = null ,
185
+ install_dir : std.Build.InstallDir ,
186
+ };
187
+
174
188
pub fn emccStep (
175
189
b : * std.Build ,
176
190
wasm : * std.Build.Step.Compile ,
191
+ <<<<<<< HEAD
177
192
options : struct {
178
193
optimize : std.builtin.OptimizeMode ,
179
194
flags : EmccFlags ,
@@ -184,6 +199,9 @@ pub fn emccStep(
184
199
shell_file_path : ? std.Build.LazyPath = null ,
185
200
install_dir : std.Build.InstallDir ,
186
201
},
202
+ ====== =
203
+ options : StepOptions ,
204
+ >>>>>>> c0b8b70 (build.zig : pulled out the options to its own structs )
187
205
) * std.Build.Step {
188
206
var emcc = b .addSystemCommand (&.{emccPath (b )});
189
207
0 commit comments