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