mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-08 06:44:27 +00:00
zig build: support single-threaded builds
and fix the zig test suite not setting the --single-threaded flag
This commit is contained in:
parent
a5b47bc2c2
commit
846f72b57c
2 changed files with 8 additions and 1 deletions
|
|
@ -943,6 +943,7 @@ pub const LibExeObjStep = struct {
|
||||||
exec_cmd_args: ?[]const ?[]const u8,
|
exec_cmd_args: ?[]const ?[]const u8,
|
||||||
name_prefix: []const u8,
|
name_prefix: []const u8,
|
||||||
filter: ?[]const u8,
|
filter: ?[]const u8,
|
||||||
|
single_threaded: bool,
|
||||||
|
|
||||||
root_src: ?[]const u8,
|
root_src: ?[]const u8,
|
||||||
out_h_filename: []const u8,
|
out_h_filename: []const u8,
|
||||||
|
|
@ -1045,6 +1046,7 @@ pub const LibExeObjStep = struct {
|
||||||
.disable_gen_h = false,
|
.disable_gen_h = false,
|
||||||
.output_dir = null,
|
.output_dir = null,
|
||||||
.need_system_paths = false,
|
.need_system_paths = false,
|
||||||
|
.single_threaded = false,
|
||||||
};
|
};
|
||||||
self.computeOutFileNames();
|
self.computeOutFileNames();
|
||||||
return self;
|
return self;
|
||||||
|
|
@ -1206,7 +1208,7 @@ pub const LibExeObjStep = struct {
|
||||||
pub fn setMainPkgPath(self: *LibExeObjStep, dir_path: []const u8) void {
|
pub fn setMainPkgPath(self: *LibExeObjStep, dir_path: []const u8) void {
|
||||||
self.main_pkg_path = dir_path;
|
self.main_pkg_path = dir_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void {
|
pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void {
|
||||||
self.disable_gen_h = value;
|
self.disable_gen_h = value;
|
||||||
}
|
}
|
||||||
|
|
@ -1411,6 +1413,10 @@ pub const LibExeObjStep = struct {
|
||||||
zig_args.append("--strip") catch unreachable;
|
zig_args.append("--strip") catch unreachable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self.single_threaded) {
|
||||||
|
try zig_args.append("--single-threaded");
|
||||||
|
}
|
||||||
|
|
||||||
switch (self.build_mode) {
|
switch (self.build_mode) {
|
||||||
builtin.Mode.Debug => {},
|
builtin.Mode.Debug => {},
|
||||||
builtin.Mode.ReleaseSafe => zig_args.append("--release-safe") catch unreachable,
|
builtin.Mode.ReleaseSafe => zig_args.append("--release-safe") catch unreachable,
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ pub fn addPkgTests(b: *build.Builder, test_filter: ?[]const u8, root_src: []cons
|
||||||
if (link_libc) "c" else "bare",
|
if (link_libc) "c" else "bare",
|
||||||
if (single_threaded) "single" else "multi",
|
if (single_threaded) "single" else "multi",
|
||||||
));
|
));
|
||||||
|
these_tests.single_threaded = single_threaded;
|
||||||
these_tests.setFilter(test_filter);
|
these_tests.setFilter(test_filter);
|
||||||
these_tests.setBuildMode(mode);
|
these_tests.setBuildMode(mode);
|
||||||
if (!is_native) {
|
if (!is_native) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue