authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2021-10-29 13:52:06-06:00
committergravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2021-11-09 14:20:28-07:00
logc13166ee8574c79afd1487e26722861cfaa632d9
treef94e2df57780190217698b15800290da68cafab9
parentcebac8c66256e1f904b44b101c0d9ee583c26148

Omit array type for pathJoin calls


1 files changed, 17 insertions(+), 17 deletions(-)

lib/std/build.zig+17-17
......@@ -204,10 +204,10 @@ pub const Builder = struct {
204204 pub fn resolveInstallPrefix(self: *Builder, install_prefix: ?[]const u8, dir_list: DirList) void {
205205 if (self.dest_dir) |dest_dir| {
206206 self.install_prefix = install_prefix orelse "/usr";
207 self.install_path = self.pathJoin(&[_][]const u8{ dest_dir, self.install_prefix });
207 self.install_path = self.pathJoin(&.{ dest_dir, self.install_prefix });
208208 } else {
209209 self.install_prefix = install_prefix orelse
210 (self.pathJoin(&[_][]const u8{ self.build_root, "zig-out" }));
210 (self.pathJoin(&.{ self.build_root, "zig-out" }));
211211 self.install_path = self.install_prefix;
212212 }
213213
......@@ -1103,7 +1103,7 @@ pub const Builder = struct {
11031103 if (fs.path.isAbsolute(name)) {
11041104 return name;
11051105 }
1106 const full_path = self.pathJoin(&[_][]const u8{
1106 const full_path = self.pathJoin(&.{
11071107 search_prefix,
11081108 "bin",
11091109 self.fmt("{s}{s}", .{ name, exe_extension }),
......@@ -1118,7 +1118,7 @@ pub const Builder = struct {
11181118 }
11191119 var it = mem.tokenize(u8, PATH, &[_]u8{fs.path.delimiter});
11201120 while (it.next()) |path| {
1121 const full_path = self.pathJoin(&[_][]const u8{
1121 const full_path = self.pathJoin(&.{
11221122 path,
11231123 self.fmt("{s}{s}", .{ name, exe_extension }),
11241124 });
......@@ -1131,7 +1131,7 @@ pub const Builder = struct {
11311131 return name;
11321132 }
11331133 for (paths) |path| {
1134 const full_path = self.pathJoin(&[_][]const u8{
1134 const full_path = self.pathJoin(&.{
11351135 path,
11361136 self.fmt("{s}{s}", .{ name, exe_extension }),
11371137 });
......@@ -1230,7 +1230,7 @@ pub const Builder = struct {
12301230 .bin => self.exe_dir,
12311231 .lib => self.lib_dir,
12321232 .header => self.h_dir,
1233 .custom => |path| self.pathJoin(&[_][]const u8{ self.install_path, path }),
1233 .custom => |path| self.pathJoin(&.{ self.install_path, path }),
12341234 };
12351235 return fs.path.resolve(
12361236 self.allocator,
......@@ -1707,7 +1707,7 @@ pub const LibExeObjStep = struct {
17071707 }
17081708 if (self.output_dir != null) {
17091709 self.output_lib_path_source.path = self.builder.pathJoin(
1710 &[_][]const u8{ self.output_dir.?, self.out_lib_filename },
1710 &.{ self.output_dir.?, self.out_lib_filename },
17111711 );
17121712 }
17131713 }
......@@ -2135,14 +2135,14 @@ pub const LibExeObjStep = struct {
21352135 const triplet = try self.target.vcpkgTriplet(allocator, if (linkage == .static) .Static else .Dynamic);
21362136 defer self.builder.allocator.free(triplet);
21372137
2138 const include_path = self.pathJoin(&[_][]const u8{ root, "installed", triplet, "include" });
2138 const include_path = self.builder.pathJoin(&.{ root, "installed", triplet, "include" });
21392139 errdefer allocator.free(include_path);
21402140 try self.include_dirs.append(IncludeDir{ .raw_path = include_path });
21412141
2142 const lib_path = self.pathJoin(&[_][]const u8{ root, "installed", triplet, "lib" });
2142 const lib_path = self.builder.pathJoin(&.{ root, "installed", triplet, "lib" });
21432143 try self.lib_paths.append(lib_path);
21442144
2145 self.vcpkg_bin_path = self.pathJoin(&[_][]const u8{ root, "installed", triplet, "bin" });
2145 self.vcpkg_bin_path = self.builder.pathJoin(&.{ root, "installed", triplet, "bin" });
21462146 },
21472147 }
21482148 }
......@@ -2642,11 +2642,11 @@ pub const LibExeObjStep = struct {
26422642
26432643 for (builder.search_prefixes.items) |search_prefix| {
26442644 try zig_args.append("-L");
2645 try zig_args.append(builder.pathJoin(&[_][]const u8{
2645 try zig_args.append(builder.pathJoin(&.{
26462646 search_prefix, "lib",
26472647 }));
26482648 try zig_args.append("-isystem");
2649 try zig_args.append(builder.pathJoin(&[_][]const u8{
2649 try zig_args.append(builder.pathJoin(&.{
26502650 search_prefix, "include",
26512651 }));
26522652 }
......@@ -2752,18 +2752,18 @@ pub const LibExeObjStep = struct {
27522752 // Update generated files
27532753 if (self.output_dir != null) {
27542754 self.output_path_source.path = builder.pathJoin(
2755 &[_][]const u8{ self.output_dir.?, self.out_filename },
2755 &.{ self.output_dir.?, self.out_filename },
27562756 );
27572757
27582758 if (self.emit_h) {
27592759 self.output_h_path_source.path = builder.pathJoin(
2760 &[_][]const u8{ self.output_dir.?, self.out_h_filename },
2760 &.{ self.output_dir.?, self.out_h_filename },
27612761 );
27622762 }
27632763
27642764 if (self.target.isWindows() or self.target.isUefi()) {
27652765 self.output_pdb_path_source.path = builder.pathJoin(
2766 &[_][]const u8{ self.output_dir.?, self.out_pdb_filename },
2766 &.{ self.output_dir.?, self.out_pdb_filename },
27672767 );
27682768 }
27692769 }
......@@ -2945,11 +2945,11 @@ pub const InstallDirStep = struct {
29452945 }
29462946 }
29472947
2948 const full_path = self.builder.pathJoin(&[_][]const u8{
2948 const full_path = self.builder.pathJoin(&.{
29492949 full_src_dir, entry.path,
29502950 });
29512951
2952 const dest_path = self.builder.pathJoin(&[_][]const u8{
2952 const dest_path = self.builder.pathJoin(&.{
29532953 dest_prefix, entry.path,
29542954 });
29552955