diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2021-06-09 10:23:46 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2021-06-09 11:11:55 +0200 |
| commit | 9f8de83d931f1f59ffa7010afc52a1bd54778447 (patch) | |
| tree | 177ff2d1a4a011a47b320f6726bf9ddfd47a9005 /src/Compilation.zig | |
| parent | bf568ec62a06fcea5f09c725529635425f1b8a76 (diff) | |
| download | zig-9f8de83d931f1f59ffa7010afc52a1bd54778447.tar.gz zig-9f8de83d931f1f59ffa7010afc52a1bd54778447.zip | |
cc,wasi: use wasi_libc.CRTFile directly instead of WasiExecModel
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index e90c635808..5c75caa598 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -603,11 +603,6 @@ pub const ClangPreprocessorMode = enum { stdout, }; -pub const WasiExecModel = enum { - command, - reactor, -}; - pub const InitOptions = struct { zig_lib_directory: Directory, local_cache_directory: Directory, @@ -731,7 +726,7 @@ pub const InitOptions = struct { test_name_prefix: ?[]const u8 = null, subsystem: ?std.Target.SubSystem = null, /// WASI-only. Type of WASI execution model ("command" or "reactor"). - wasi_exec_model: ?WasiExecModel = null, + wasi_exec_model: ?wasi_libc.CRTFile = null, }; fn addPackageTableToCacheHash( @@ -1449,14 +1444,8 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { .wasi_libc_crt_file = crt_file, }); } - const crt_file: wasi_libc.CRTFile = if (comp.bin_file.options.wasi_exec_model) |exec_model| crt_file: { - switch (exec_model) { - .command => break :crt_file wasi_libc.CRTFile.crt1_command_o, - .reactor => break :crt_file wasi_libc.CRTFile.crt1_reactor_o, - } - } else .crt1_o; comp.work_queue.writeAssumeCapacity(&[_]Job{ - .{ .wasi_libc_crt_file = crt_file }, + .{ .wasi_libc_crt_file = comp.bin_file.options.wasi_exec_model orelse .crt1_o }, .{ .wasi_libc_crt_file = .libc_a }, }); } |
