Skip to content

Commit 56c9f08

Browse files
authored
Allow usage of strip_include_prefix in cc_stamped_library (#179)
The use of includes in `cc_stamped_library` targets is incorrectly propagating header paths with `-isystem`, which suppresses compiler warnings in dependent targets. To resolve this, the `cc_stamped_library` macro in `rules_swiftnav` must be updated to support `strip_include_prefix` and remove its dependency on the `includes` attribute. Tested in - [x] starling-core - [x] starling
1 parent 299794d commit 56c9f08

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cc/defs.bzl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _tests_warn_deprecated_declarations():
143143
"//conditions:default": ["-Wno-deprecated-declarations"],
144144
})
145145

146-
def cc_stamped_library(name, out, template, hdrs, includes, defaults, visibility = None):
146+
def cc_stamped_library(name, out, template, hdrs, defaults, **kwargs):
147147
"""Creates a cc_library stamped with non-hermetic build metadata.
148148
149149
Creates a cc_library from the input template with values of the form @VAL@
@@ -165,15 +165,16 @@ def cc_stamped_library(name, out, template, hdrs, includes, defaults, visibility
165165
out: The expanded source file
166166
template: The input template
167167
hdrs: See https://bazel.build/reference/be/c-cpp#cc_library.hdrs
168-
includes: See https://bazel.build/reference/be/c-cpp#cc_library.includes
169168
defaults: Dict of default values when stamping is not enabled
170-
visibility: See https://bazel.build/reference/be/common-definitions#common.visibility
169+
**kwargs: See https://bazel.build/reference/be/c-cpp#cc_library
171170
"""
172171

173172
source_name = name + "_"
174173

175174
stamp_file(name = source_name, out = out, defaults = defaults, template = template)
176175

176+
visibility = kwargs.pop("visibility", [])
177+
177178
# This variant has the stamped symbols in the archive
178179
swift_cc_library(
179180
name = name + STAMPED_LIB_SUFFIX,
@@ -185,9 +186,9 @@ def cc_stamped_library(name, out, template, hdrs, includes, defaults, visibility
185186
swift_cc_library(
186187
name = name,
187188
hdrs = hdrs,
188-
includes = includes,
189189
linkstamp = source_name,
190190
visibility = visibility,
191+
**kwargs
191192
)
192193

193194
def cc_static_library(name, deps, visibility = ["//visibility:private"]):

0 commit comments

Comments
 (0)