diff options
| author | Luuk de Gram <luuk@degram.dev> | 2023-06-26 19:10:34 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2023-06-26 20:00:58 +0200 |
| commit | 87b8a0567b0f54415aeecd879d3f1a4e12014d22 (patch) | |
| tree | 77cea5728d61fd701009a40e6ac0c70ce282c69a /src/Compilation.zig | |
| parent | e06ab1b0107e8a6a1720703a6df0f61f535b5e5a (diff) | |
| download | zig-87b8a0567b0f54415aeecd879d3f1a4e12014d22.tar.gz zig-87b8a0567b0f54415aeecd879d3f1a4e12014d22.zip | |
default to single-threaded for WebAssembly
When targeting WebAssembly, we default to building a single-threaded build
as threads are still experimental. The user however can enable a multi-
threaded build by specifying '-fno-single-threaded'. It's a compile-error
to enable this flag, but not also enable shared-memory.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index fe13df8097..4e0a36d652 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1029,7 +1029,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { const include_compiler_rt = options.want_compiler_rt orelse needs_c_symbols; - const must_single_thread = options.target.isWasm() and !options.linker_shared_memory; + const must_single_thread = target_util.isSingleThreaded(options.target); const single_threaded = options.single_threaded orelse must_single_thread; if (must_single_thread and !single_threaded) { return error.TargetRequiresSingleThreaded; |
