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 {...@@ -204,10 +204,10 @@ pub const Builder = struct {
204 pub fn resolveInstallPrefix(self: *Builder, install_prefix: ?[]const u8, dir_list: DirList) void {204 pub fn resolveInstallPrefix(self: *Builder, install_prefix: ?[]const u8, dir_list: DirList) void {
205 if (self.dest_dir) |dest_dir| {205 if (self.dest_dir) |dest_dir| {
206 self.install_prefix = install_prefix orelse "/usr";206 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 });
208 } else {208 } else {
209 self.install_prefix = install_prefix orelse209 self.install_prefix = install_prefix orelse
210 (self.pathJoin(&[_][]const u8{ self.build_root, "zig-out" }));210 (self.pathJoin(&.{ self.build_root, "zig-out" }));
211 self.install_path = self.install_prefix;211 self.install_path = self.install_prefix;
212 }212 }
213213
...@@ -1103,7 +1103,7 @@ pub const Builder = struct {...@@ -1103,7 +1103,7 @@ pub const Builder = struct {
1103 if (fs.path.isAbsolute(name)) {1103 if (fs.path.isAbsolute(name)) {
1104 return name;1104 return name;
1105 }1105 }
1106 const full_path = self.pathJoin(&[_][]const u8{1106 const full_path = self.pathJoin(&.{
1107 search_prefix,1107 search_prefix,
1108 "bin",1108 "bin",
1109 self.fmt("{s}{s}", .{ name, exe_extension }),1109 self.fmt("{s}{s}", .{ name, exe_extension }),
...@@ -1118,7 +1118,7 @@ pub const Builder = struct {...@@ -1118,7 +1118,7 @@ pub const Builder = struct {
1118 }1118 }
1119 var it = mem.tokenize(u8, PATH, &[_]u8{fs.path.delimiter});1119 var it = mem.tokenize(u8, PATH, &[_]u8{fs.path.delimiter});
1120 while (it.next()) |path| {1120 while (it.next()) |path| {
1121 const full_path = self.pathJoin(&[_][]const u8{1121 const full_path = self.pathJoin(&.{
1122 path,1122 path,
1123 self.fmt("{s}{s}", .{ name, exe_extension }),1123 self.fmt("{s}{s}", .{ name, exe_extension }),
1124 });1124 });
...@@ -1131,7 +1131,7 @@ pub const Builder = struct {...@@ -1131,7 +1131,7 @@ pub const Builder = struct {
1131 return name;1131 return name;
1132 }1132 }
1133 for (paths) |path| {1133 for (paths) |path| {
1134 const full_path = self.pathJoin(&[_][]const u8{1134 const full_path = self.pathJoin(&.{
1135 path,1135 path,
1136 self.fmt("{s}{s}", .{ name, exe_extension }),1136 self.fmt("{s}{s}", .{ name, exe_extension }),
1137 });1137 });
...@@ -1230,7 +1230,7 @@ pub const Builder = struct {...@@ -1230,7 +1230,7 @@ pub const Builder = struct {
1230 .bin => self.exe_dir,1230 .bin => self.exe_dir,
1231 .lib => self.lib_dir,1231 .lib => self.lib_dir,
1232 .header => self.h_dir,1232 .header => self.h_dir,
1233 .custom => |path| self.pathJoin(&[_][]const u8{ self.install_path, path }),1233 .custom => |path| self.pathJoin(&.{ self.install_path, path }),
1234 };1234 };
1235 return fs.path.resolve(1235 return fs.path.resolve(
1236 self.allocator,1236 self.allocator,
...@@ -1707,7 +1707,7 @@ pub const LibExeObjStep = struct {...@@ -1707,7 +1707,7 @@ pub const LibExeObjStep = struct {
1707 }1707 }
1708 if (self.output_dir != null) {1708 if (self.output_dir != null) {
1709 self.output_lib_path_source.path = self.builder.pathJoin(1709 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 },
1711 );1711 );
1712 }1712 }
1713 }1713 }
...@@ -2135,14 +2135,14 @@ pub const LibExeObjStep = struct {...@@ -2135,14 +2135,14 @@ pub const LibExeObjStep = struct {
2135 const triplet = try self.target.vcpkgTriplet(allocator, if (linkage == .static) .Static else .Dynamic);2135 const triplet = try self.target.vcpkgTriplet(allocator, if (linkage == .static) .Static else .Dynamic);
2136 defer self.builder.allocator.free(triplet);2136 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" });
2139 errdefer allocator.free(include_path);2139 errdefer allocator.free(include_path);
2140 try self.include_dirs.append(IncludeDir{ .raw_path = include_path });2140 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" });
2143 try self.lib_paths.append(lib_path);2143 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" });
2146 },2146 },
2147 }2147 }
2148 }2148 }
...@@ -2642,11 +2642,11 @@ pub const LibExeObjStep = struct {...@@ -2642,11 +2642,11 @@ pub const LibExeObjStep = struct {
26422642
2643 for (builder.search_prefixes.items) |search_prefix| {2643 for (builder.search_prefixes.items) |search_prefix| {
2644 try zig_args.append("-L");2644 try zig_args.append("-L");
2645 try zig_args.append(builder.pathJoin(&[_][]const u8{2645 try zig_args.append(builder.pathJoin(&.{
2646 search_prefix, "lib",2646 search_prefix, "lib",
2647 }));2647 }));
2648 try zig_args.append("-isystem");2648 try zig_args.append("-isystem");
2649 try zig_args.append(builder.pathJoin(&[_][]const u8{2649 try zig_args.append(builder.pathJoin(&.{
2650 search_prefix, "include",2650 search_prefix, "include",
2651 }));2651 }));
2652 }2652 }
...@@ -2752,18 +2752,18 @@ pub const LibExeObjStep = struct {...@@ -2752,18 +2752,18 @@ pub const LibExeObjStep = struct {
2752 // Update generated files2752 // Update generated files
2753 if (self.output_dir != null) {2753 if (self.output_dir != null) {
2754 self.output_path_source.path = builder.pathJoin(2754 self.output_path_source.path = builder.pathJoin(
2755 &[_][]const u8{ self.output_dir.?, self.out_filename },2755 &.{ self.output_dir.?, self.out_filename },
2756 );2756 );
27572757
2758 if (self.emit_h) {2758 if (self.emit_h) {
2759 self.output_h_path_source.path = builder.pathJoin(2759 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 },
2761 );2761 );
2762 }2762 }
27632763
2764 if (self.target.isWindows() or self.target.isUefi()) {2764 if (self.target.isWindows() or self.target.isUefi()) {
2765 self.output_pdb_path_source.path = builder.pathJoin(2765 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 },
2767 );2767 );
2768 }2768 }
2769 }2769 }
...@@ -2945,11 +2945,11 @@ pub const InstallDirStep = struct {...@@ -2945,11 +2945,11 @@ pub const InstallDirStep = struct {
2945 }2945 }
2946 }2946 }
29472947
2948 const full_path = self.builder.pathJoin(&[_][]const u8{2948 const full_path = self.builder.pathJoin(&.{
2949 full_src_dir, entry.path,2949 full_src_dir, entry.path,
2950 });2950 });
29512951
2952 const dest_path = self.builder.pathJoin(&[_][]const u8{2952 const dest_path = self.builder.pathJoin(&.{
2953 dest_prefix, entry.path,2953 dest_prefix, entry.path,
2954 });2954 });
29552955