diff options
| author | Takeshi Yoneda <takeshi@tetrate.io> | 2021-06-09 17:07:06 +0900 |
|---|---|---|
| committer | Takeshi Yoneda <takeshi@tetrate.io> | 2021-06-09 17:07:06 +0900 |
| commit | bf568ec62a06fcea5f09c725529635425f1b8a76 (patch) | |
| tree | e30c6d3a7e773aa3a6ad0818c27a8c315475c2e8 /src/main.zig | |
| parent | a6ae5a77dac6466617cdf57357aa79c2b79403b3 (diff) | |
| download | zig-bf568ec62a06fcea5f09c725529635425f1b8a76.tar.gz zig-bf568ec62a06fcea5f09c725529635425f1b8a76.zip | |
cc,wasi: support WASI reactors via -mexec-model flag.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index 0b93f97726..8b1c640cfb 100644 --- a/src/main.zig +++ b/src/main.zig @@ -613,6 +613,7 @@ fn buildOutputType( var subsystem: ?std.Target.SubSystem = null; var major_subsystem_version: ?u32 = null; var minor_subsystem_version: ?u32 = null; + var wasi_exec_model: ?Compilation.WasiExecModel = null; var system_libs = std.ArrayList([]const u8).init(gpa); defer system_libs.deinit(); @@ -1254,6 +1255,13 @@ fn buildOutputType( .framework => try frameworks.append(it.only_arg), .nostdlibinc => want_native_include_dirs = false, .strip => strip = true, + .exec_model => { + if (std.mem.eql(u8, it.only_arg, "reactor")) { + wasi_exec_model = Compilation.WasiExecModel.reactor; + } else if (std.mem.eql(u8, it.only_arg, "command")) { + wasi_exec_model = Compilation.WasiExecModel.command; + } + }, } } // Parse linker args. @@ -1969,6 +1977,7 @@ fn buildOutputType( .test_name_prefix = test_name_prefix, .disable_lld_caching = !have_enable_cache, .subsystem = subsystem, + .wasi_exec_model = wasi_exec_model, }) catch |err| { fatal("unable to create compilation: {s}", .{@errorName(err)}); }; @@ -3341,6 +3350,7 @@ pub const ClangArgIterator = struct { red_zone, no_red_zone, strip, + exec_model, }; const Args = struct { |
