authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-05 14:54:37-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-05 14:54:37-04:00
log846f72b57cb56f67cedaa2113c3ff7b8c548d979
tree23d5b1884904b13ca2b5b56adfe21765f41af8ac
parenta5b47bc2c2de54ea853ac48e745c75c499d5c9bb
signaturelock-open Commit is signed but in an unrecognized format.

zig build: support single-threaded builds

and fix the zig test suite not setting the --single-threaded flag

2 files changed, 8 insertions(+), 1 deletions(-)

std/build.zig+7-1
......@@ -943,6 +943,7 @@ pub const LibExeObjStep = struct {
943943 exec_cmd_args: ?[]const ?[]const u8,
944944 name_prefix: []const u8,
945945 filter: ?[]const u8,
946 single_threaded: bool,
946947
947948 root_src: ?[]const u8,
948949 out_h_filename: []const u8,
......@@ -1045,6 +1046,7 @@ pub const LibExeObjStep = struct {
10451046 .disable_gen_h = false,
10461047 .output_dir = null,
10471048 .need_system_paths = false,
1049 .single_threaded = false,
10481050 };
10491051 self.computeOutFileNames();
10501052 return self;
......@@ -1206,7 +1208,7 @@ pub const LibExeObjStep = struct {
12061208 pub fn setMainPkgPath(self: *LibExeObjStep, dir_path: []const u8) void {
12071209 self.main_pkg_path = dir_path;
12081210 }
1209
1211
12101212 pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void {
12111213 self.disable_gen_h = value;
12121214 }
......@@ -1411,6 +1413,10 @@ pub const LibExeObjStep = struct {
14111413 zig_args.append("--strip") catch unreachable;
14121414 }
14131415
1416 if (self.single_threaded) {
1417 try zig_args.append("--single-threaded");
1418 }
1419
14141420 switch (self.build_mode) {
14151421 builtin.Mode.Debug => {},
14161422 builtin.Mode.ReleaseSafe => zig_args.append("--release-safe") catch unreachable,
test/tests.zig+1
......@@ -186,6 +186,7 @@ pub fn addPkgTests(b: *build.Builder, test_filter: ?[]const u8, root_src: []cons
186186 if (link_libc) "c" else "bare",
187187 if (single_threaded) "single" else "multi",
188188 ));
189 these_tests.single_threaded = single_threaded;
189190 these_tests.setFilter(test_filter);
190191 these_tests.setBuildMode(mode);
191192 if (!is_native) {