| ... | @@ -1048,6 +1048,7 @@ pub const Builder = struct { | ... | @@ -1048,6 +1048,7 @@ pub const Builder = struct { |
| 1048 | .Bin => self.exe_dir, | 1048 | .Bin => self.exe_dir, |
| 1049 | .Lib => self.lib_dir, | 1049 | .Lib => self.lib_dir, |
| 1050 | .Header => self.h_dir, | 1050 | .Header => self.h_dir, |
| | 1051 | .Custom => |path| fs.path.join(self.allocator, &[_][]const u8{ self.install_path, path }) catch unreachable, |
| 1051 | }; | 1052 | }; |
| 1052 | return fs.path.resolve( | 1053 | return fs.path.resolve( |
| 1053 | self.allocator, | 1054 | self.allocator, |
| ... | @@ -1212,6 +1213,8 @@ pub const LibExeObjStep = struct { | ... | @@ -1212,6 +1213,8 @@ pub const LibExeObjStep = struct { |
| 1212 | is_linking_libc: bool = false, | 1213 | is_linking_libc: bool = false, |
| 1213 | vcpkg_bin_path: ?[]const u8 = null, | 1214 | vcpkg_bin_path: ?[]const u8 = null, |
| 1214 | | 1215 | |
| | 1216 | /// This may be set in order to override the default install directory |
| | 1217 | override_dest_dir: ?InstallDir, |
| 1215 | installed_path: ?[]const u8, | 1218 | installed_path: ?[]const u8, |
| 1216 | install_step: ?*InstallArtifactStep, | 1219 | install_step: ?*InstallArtifactStep, |
| 1217 | | 1220 | |
| ... | @@ -1348,6 +1351,7 @@ pub const LibExeObjStep = struct { | ... | @@ -1348,6 +1351,7 @@ pub const LibExeObjStep = struct { |
| 1348 | .rdynamic = false, | 1351 | .rdynamic = false, |
| 1349 | .output_dir = null, | 1352 | .output_dir = null, |
| 1350 | .single_threaded = false, | 1353 | .single_threaded = false, |
| | 1354 | .override_dest_dir = null, |
| 1351 | .installed_path = null, | 1355 | .installed_path = null, |
| 1352 | .install_step = null, | 1356 | .install_step = null, |
| 1353 | }; | 1357 | }; |
| ... | @@ -2309,17 +2313,17 @@ pub const InstallArtifactStep = struct { | ... | @@ -2309,17 +2313,17 @@ pub const InstallArtifactStep = struct { |
| 2309 | .builder = builder, | 2313 | .builder = builder, |
| 2310 | .step = Step.init(.InstallArtifact, builder.fmt("install {}", .{artifact.step.name}), builder.allocator, make), | 2314 | .step = Step.init(.InstallArtifact, builder.fmt("install {}", .{artifact.step.name}), builder.allocator, make), |
| 2311 | .artifact = artifact, | 2315 | .artifact = artifact, |
| 2312 | .dest_dir = switch (artifact.kind) { | 2316 | .dest_dir = artifact.override_dest_dir orelse switch (artifact.kind) { |
| 2313 | .Obj => unreachable, | 2317 | .Obj => unreachable, |
| 2314 | .Test => unreachable, | 2318 | .Test => unreachable, |
| 2315 | .Exe => .Bin, | 2319 | .Exe => InstallDir{ .Bin = {} }, |
| 2316 | .Lib => .Lib, | 2320 | .Lib => InstallDir{ .Lib = {} }, |
| 2317 | }, | 2321 | }, |
| 2318 | .pdb_dir = if (artifact.producesPdbFile()) blk: { | 2322 | .pdb_dir = if (artifact.producesPdbFile()) blk: { |
| 2319 | if (artifact.kind == .Exe) { | 2323 | if (artifact.kind == .Exe) { |
| 2320 | break :blk InstallDir.Bin; | 2324 | break :blk InstallDir{ .Bin = {} }; |
| 2321 | } else { | 2325 | } else { |
| 2322 | break :blk InstallDir.Lib; | 2326 | break :blk InstallDir{ .Lib = {} }; |
| 2323 | } | 2327 | } |
| 2324 | } else null, | 2328 | } else null, |
| 2325 | .h_dir = if (artifact.kind == .Lib and artifact.emit_h) .Header else null, | 2329 | .h_dir = if (artifact.kind == .Lib and artifact.emit_h) .Header else null, |
| ... | @@ -2615,11 +2619,13 @@ const VcpkgRootStatus = enum { | ... | @@ -2615,11 +2619,13 @@ const VcpkgRootStatus = enum { |
| 2615 | | 2619 | |
| 2616 | pub const VcpkgLinkage = std.builtin.LinkMode; | 2620 | pub const VcpkgLinkage = std.builtin.LinkMode; |
| 2617 | | 2621 | |
| 2618 | pub const InstallDir = enum { | 2622 | pub const InstallDir = union(enum) { |
| 2619 | Prefix, | 2623 | Prefix: void, |
| 2620 | Lib, | 2624 | Lib: void, |
| 2621 | Bin, | 2625 | Bin: void, |
| 2622 | Header, | 2626 | Header: void, |
| | 2627 | /// A path relative to the prefix |
| | 2628 | Custom: []const u8, |
| 2623 | }; | 2629 | }; |
| 2624 | | 2630 | |
| 2625 | pub const InstalledFile = struct { | 2631 | pub const InstalledFile = struct { |