authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-16 16:09:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-16 16:09:24-07:00
log37424fd11a79801e18a121ee7e86730012b0c55e
tree5d165f758f4b1c86bf230002d216208cfc072a28
parente45b471ad35828c5a435b6df7b672f83e8e69b6a

add std.build.LibExeObjStep.installHeadersDirectoryOptions

For when you need options such as excluding certain extensions.

1 files changed, 8 insertions(+), 1 deletions(-)

lib/std/build/LibExeObjStep.zig+8-1
...@@ -486,11 +486,18 @@ pub fn installHeadersDirectory(...@@ -486,11 +486,18 @@ pub fn installHeadersDirectory(
486 src_dir_path: []const u8,486 src_dir_path: []const u8,
487 dest_rel_path: []const u8,487 dest_rel_path: []const u8,
488) void {488) void {
489 const install_dir = a.builder.addInstallDirectory(.{489 return a.builder.addInstallDirectoryOptions(.{
490 .source_dir = src_dir_path,490 .source_dir = src_dir_path,
491 .install_dir = .header,491 .install_dir = .header,
492 .install_subdir = dest_rel_path,492 .install_subdir = dest_rel_path,
493 });493 });
494}
495
496pub fn installHeadersDirectoryOptions(
497 a: *LibExeObjStep,
498 options: std.build.InstallDirStep.Options,
499) void {
500 const install_dir = a.builder.addInstallDirectory(options);
494 a.builder.getInstallStep().dependOn(&install_dir.step);501 a.builder.getInstallStep().dependOn(&install_dir.step);
495 a.installed_headers.append(&install_dir.step) catch unreachable;502 a.installed_headers.append(&install_dir.step) catch unreachable;
496}503}