Module providing means of enriching header file groups with mapping metadata.
cc_hdrs(name, deps, hdrs_map, private_hdrs, public_hdrs)
This rule allows for grouping header files as a unit and equipping them with a headers map. Thanks to this approach, information about expected include paths may be kept close to the header files themselve, instead of being repeated in multiple compilation targets.
Example:
cc_hdrs(
name = "foo_hdrs",
hdrs_map = {
"**/*.hpp": ["bar/{filename}"],
},
public_hdrs = [
"foo.hpp",
],
)
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
deps | The list of dependencies of current target | List of labels | optional | [] |
hdrs_map | Dictionary describing paths under which header files should be avaiable as. Keys are simple glob pathnames, used to match agains all header files avaiable in the rule. Values are list of paths to which matching header files should be mapped. '{filename}' is special token used to signify to matching file name. For example: '"**/*o.hpp": ["a/{filename}"]' - will ensure all hpp files with names ending with '0' will be also avaible as if they were placed in a subdirectory. |
Dictionary: String -> List of strings | optional | {} |
private_hdrs | List of headers that CANNOT be included by dependent rules. Notice: the cutoff happens during compilation. | List of labels | optional | [] |
public_hdrs | List of headers that may be included by dependent rules transitively. Notice: the cutoff happens during compilation. | List of labels | optional | [] |