Skip to content

Commit

Permalink
add std.build.LibExeObjStep.installHeadersDirectoryOptions
Browse files Browse the repository at this point in the history
For when you need options such as excluding certain extensions.
  • Loading branch information
andrewrk committed Jan 16, 2023
1 parent e45b471 commit 37424fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/std/build/LibExeObjStep.zig
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,18 @@ pub fn installHeadersDirectory(
src_dir_path: []const u8,
dest_rel_path: []const u8,
) void {
const install_dir = a.builder.addInstallDirectory(.{
return a.builder.addInstallDirectoryOptions(.{
.source_dir = src_dir_path,
.install_dir = .header,
.install_subdir = dest_rel_path,
});
}

pub fn installHeadersDirectoryOptions(
a: *LibExeObjStep,
options: std.build.InstallDirStep.Options,
) void {
const install_dir = a.builder.addInstallDirectory(options);
a.builder.getInstallStep().dependOn(&install_dir.step);
a.installed_headers.append(&install_dir.step) catch unreachable;
}
Expand Down

0 comments on commit 37424fd

Please sign in to comment.