message: Add `defines` propagation to `cc_header_only_library`
  This matches the behavior of the standard cc rules, and keeps us from needing to find header-only versions of dependencies that require `defines` propagation, just to put them in `extra_deps`.
diff: @@ -1765,6 +1765,29 @@ def transitive_hdrs(name, deps = [], **kwargs):
  _transitive_hdrs(name = name + "_gather", deps = deps)
  native.filegroup(name = name, srcs = [":" + name + "_gather"])
  +# Bazel rule for collecting the transitive parameters from a set of dependencies into a library.
  +# Propagates defines.
  +def _transitive_parameters_library_impl(ctx):
  + defines = depset(
  + transitive = [dep[CcInfo].compilation_context.defines for dep in ctx.attr.original_deps],
  + )
  + return CcInfo(
  + compilation_context = cc_common.create_compilation_context(
  + defines = depset(direct = defines.to_list()),
  + ),
  + )
  +
  +_transitive_parameters_library = rule(
  + attrs = {
  + "original_deps": attr.label_list(
  + allow_empty = True,
  + allow_files = True,
  + providers = [CcInfo],
  + ),
  + },
  + implementation = _transitive_parameters_library_impl,
  +)
  +
  # Create a header only library that includes all the headers exported by
  # the libraries in deps.
  #
  @@ -1783,11 +1806,15 @@ def transitive_hdrs(name, deps = [], **kwargs):
  #
  def cc_header_only_library(name, deps = [], includes = [], extra_deps = [], **kwargs):
  _transitive_hdrs(name = name + "_gather", deps = deps)
  + _transitive_parameters_library(
  + name = name + "_gathered_parameters",
  + original_deps = deps,
  + )
  cc_library(
  name = name,
  hdrs = [":" + name + "_gather"],
  includes = includes,
  - deps = extra_deps,
  + deps = [":" + name + "_gathered_parameters"] + extra_deps,
  **kwargs
  )
  