authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-17 00:45:04-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-17 00:45:04-07:00
log65586b9869f2f4ed9dfb4d90d6cad3f3e9912f79
treea81a65698053ed61702d7fceefca004e802cdd3e
parent6db3869fc767f595e6d28f02ded59f20ec4da83d

std.build.LibExeObjStep: change installHeader API

Now it always takes a dest_rel_path parameter, making it slightly more verbose, and much more useful.

1 files changed, 3 insertions(+), 4 deletions(-)

lib/std/build/LibExeObjStep.zig+3-4
...@@ -474,9 +474,8 @@ pub fn installRaw(self: *LibExeObjStep, dest_filename: []const u8, options: Inst...@@ -474,9 +474,8 @@ pub fn installRaw(self: *LibExeObjStep, dest_filename: []const u8, options: Inst
474 return self.builder.installRaw(self, dest_filename, options);474 return self.builder.installRaw(self, dest_filename, options);
475}475}
476476
477pub fn installHeader(a: *LibExeObjStep, src_path: []const u8) void {477pub fn installHeader(a: *LibExeObjStep, src_path: []const u8, dest_rel_path: []const u8) void {
478 const basename = fs.path.basename(src_path);478 const install_file = a.builder.addInstallHeaderFile(src_path, dest_rel_path);
479 const install_file = a.builder.addInstallHeaderFile(src_path, basename);
480 a.builder.getInstallStep().dependOn(&install_file.step);479 a.builder.getInstallStep().dependOn(&install_file.step);
481 a.installed_headers.append(&install_file.step) catch unreachable;480 a.installed_headers.append(&install_file.step) catch unreachable;
482}481}
...@@ -486,7 +485,7 @@ pub fn installHeadersDirectory(...@@ -486,7 +485,7 @@ pub fn installHeadersDirectory(
486 src_dir_path: []const u8,485 src_dir_path: []const u8,
487 dest_rel_path: []const u8,486 dest_rel_path: []const u8,
488) void {487) void {
489 return a.builder.addInstallDirectoryOptions(.{488 return installHeadersDirectoryOptions(a, .{
490 .source_dir = src_dir_path,489 .source_dir = src_dir_path,
491 .install_dir = .header,490 .install_dir = .header,
492 .install_subdir = dest_rel_path,491 .install_subdir = dest_rel_path,