etl/BUILD.bazel
Roland Reichwein 40dddd7f96
Add optional etl_profile label_flag for Bazel profile injection (#1491)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 23:41:17 +02:00

37 lines
1.1 KiB
Python

load("@rules_cc//cc:defs.bzl", "cc_library")
package(default_visibility = ["//visibility:public"])
# ETL can be tailored to a project through an `etl_profile.h` header (see
# `include/etl/platform.h`). When no such header is on the include path, ETL
# falls back to its built-in defaults via `ETL_NO_PROFILE_HEADER`.
#
# This label_flag lets a consumer inject that profile as a Bazel target, without
# patching this BUILD file:
#
# bazel build @etl//:etl --@etl//:etl_profile=//path/to:my_etl_profile
#
# The injected target is a cc_library that exposes a single `etl_profile.h` on
# its include path, for example:
#
# cc_library(
# name = "my_etl_profile",
# hdrs = ["etl_profile.h"],
# strip_include_prefix = ".",
# )
#
# The default is empty, so ETL's built-in defaults are used unless overridden.
label_flag(
name = "etl_profile",
build_setting_default = ":no_profile",
)
cc_library(name = "no_profile")
cc_library(
name = "etl",
hdrs = glob(["include/**/*.h"]),
includes = ["include"],
deps = [":etl_profile"],
)