diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl index b82d3130563cd..32f717bc44d06 100644 --- a/bazel/envoy_build_system.bzl +++ b/bazel/envoy_build_system.bzl @@ -54,6 +54,13 @@ def envoy_include_prefix(path): return '/'.join(path.split('/')[1:]) return None +# Envoy C++ library targets that need no transformations or additional dependencies before being +# passed to cc_library should be specified with this function. Note: this exists to ensure that +# all envoy targets pass through an envoy-declared skylark function where they can be modified +# before being passed to a native bazel function. +def envoy_basic_cc_library(name, **kargs): + native.cc_library(name = name, **kargs) + # Envoy C++ library targets should be specified with this function. def envoy_cc_library(name, srcs = [], diff --git a/include/envoy/common/BUILD b/include/envoy/common/BUILD index 6a9792e2310fd..97ac34438fe66 100644 --- a/include/envoy/common/BUILD +++ b/include/envoy/common/BUILD @@ -3,12 +3,13 @@ licenses(["notice"]) # Apache 2 load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", + "envoy_basic_cc_library", "envoy_package", ) envoy_package() -cc_library( +envoy_basic_cc_library( name = "base_includes", hdrs = [ "exception.h", diff --git a/test/test_common/BUILD b/test/test_common/BUILD index bfd363cae7fd2..98b306158ecf3 100644 --- a/test/test_common/BUILD +++ b/test/test_common/BUILD @@ -3,13 +3,14 @@ licenses(["notice"]) # Apache 2 load( "//bazel:envoy_build_system.bzl", "envoy_cc_library", + "envoy_basic_cc_library", "envoy_cc_test_library", "envoy_package", ) envoy_package() -cc_library( +envoy_basic_cc_library( name = "printers_includes", hdrs = ["printers.h"], )