Skip to content

Commit a3cef63

Browse files
authored
allow out_data_dirs to be referenced through output groups (#1451)
This change allows one to easily reference the content of folders listed in `out_data_dirs` through an output group, instead of relying on `gen_dir` & `genrule`
1 parent 2eca712 commit a3cef63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

foreign_cc/private/framework.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ def cc_external_rule_impl(ctx, attrs):
592592
outputs.out_binary_files +
593593
outputs.libraries.static_libraries +
594594
outputs.libraries.shared_libraries +
595-
[outputs.out_include_dir] if outputs.out_include_dir else []
595+
([outputs.out_include_dir] if outputs.out_include_dir else []) +
596+
(outputs.data_dirs if outputs.data_dirs else [])
596597
)
597598
output_groups = _declare_output_groups(installdir_copy.file, output_groups)
598599
wrapped_files = [
@@ -842,6 +843,7 @@ _Outputs = provider(
842843
out_include_dir = "Directory with header files (relative to install directory)",
843844
out_binary_files = "Binary files, which will be created by the action",
844845
libraries = "Library files, which will be created by the action",
846+
data_dirs = "Directory containing additional files generated by the build",
845847
declared_outputs = "All output files and directories of the action",
846848
),
847849
)
@@ -898,6 +900,7 @@ def _define_outputs(ctx, attrs, lib_name):
898900
out_include_dir = out_include_dir,
899901
out_binary_files = out_binary_files,
900902
libraries = libraries,
903+
data_dirs = out_data_dirs,
901904
declared_outputs = declared_outputs,
902905
)
903906

0 commit comments

Comments
 (0)