diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-04-05 14:54:37 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-04-05 14:54:37 -0400 |
| commit | 846f72b57cb56f67cedaa2113c3ff7b8c548d979 (patch) | |
| tree | 23d5b1884904b13ca2b5b56adfe21765f41af8ac /std | |
| parent | a5b47bc2c2de54ea853ac48e745c75c499d5c9bb (diff) | |
| download | zig-846f72b57cb56f67cedaa2113c3ff7b8c548d979.tar.gz zig-846f72b57cb56f67cedaa2113c3ff7b8c548d979.zip | |
zig build: support single-threaded builds
and fix the zig test suite not setting the --single-threaded flag
Diffstat (limited to 'std')
| -rw-r--r-- | std/build.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/std/build.zig b/std/build.zig index f0c4330660..2bd4a9b08f 100644 --- a/std/build.zig +++ b/std/build.zig @@ -943,6 +943,7 @@ pub const LibExeObjStep = struct { exec_cmd_args: ?[]const ?[]const u8, name_prefix: []const u8, filter: ?[]const u8, + single_threaded: bool, root_src: ?[]const u8, out_h_filename: []const u8, @@ -1045,6 +1046,7 @@ pub const LibExeObjStep = struct { .disable_gen_h = false, .output_dir = null, .need_system_paths = false, + .single_threaded = false, }; self.computeOutFileNames(); return self; @@ -1206,7 +1208,7 @@ pub const LibExeObjStep = struct { pub fn setMainPkgPath(self: *LibExeObjStep, dir_path: []const u8) void { self.main_pkg_path = dir_path; } - + pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void { self.disable_gen_h = value; } @@ -1411,6 +1413,10 @@ pub const LibExeObjStep = struct { zig_args.append("--strip") catch unreachable; } + if (self.single_threaded) { + try zig_args.append("--single-threaded"); + } + switch (self.build_mode) { builtin.Mode.Debug => {}, builtin.Mode.ReleaseSafe => zig_args.append("--release-safe") catch unreachable, |
