motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 65586b9869f2f4ed9dfb4d90d6cad3f3e9912f79 (tree)
parent 6db3869fc767f595e6d28f02ded59f20ec4da83d
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue, 17 Jan 2023 00:45:04 -0700

std.build.LibExeObjStep: change installHeader API

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

Diffstat:
Mlib/std/build/LibExeObjStep.zig | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/std/build/LibExeObjStep.zig b/lib/std/build/LibExeObjStep.zig @@ -474,9 +474,8 @@ pub fn installRaw(self: *LibExeObjStep, dest_filename: []const u8, options: Inst return self.builder.installRaw(self, dest_filename, options); } -pub fn installHeader(a: *LibExeObjStep, src_path: []const u8) void { - const basename = fs.path.basename(src_path); - const install_file = a.builder.addInstallHeaderFile(src_path, basename); +pub fn installHeader(a: *LibExeObjStep, src_path: []const u8, dest_rel_path: []const u8) void { + const install_file = a.builder.addInstallHeaderFile(src_path, dest_rel_path); a.builder.getInstallStep().dependOn(&install_file.step); a.installed_headers.append(&install_file.step) catch unreachable; } @@ -486,7 +485,7 @@ pub fn installHeadersDirectory( src_dir_path: []const u8, dest_rel_path: []const u8, ) void { - return a.builder.addInstallDirectoryOptions(.{ + return installHeadersDirectoryOptions(a, .{ .source_dir = src_dir_path, .install_dir = .header, .install_subdir = dest_rel_path,