Skip to content

Commit 3d7c5ae

Browse files
keithcopybara-github
authored andcommitted
Fix -fatal_warnings on macOS
Fixes #20919 Closes #20924. PiperOrigin-RevId: 601022242 Change-Id: I257023dcf9983cb2b3ce16079675f6b5f9409b86
1 parent 7d9f07f commit 3d7c5ae

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tools/cpp/unix_cc_toolchain_config.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
"""A Starlark cc_toolchain configuration rule"""
1616

17+
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
1718
load(
1819
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
1920
"action_config",
@@ -29,7 +30,6 @@ load(
2930
"variable_with_value",
3031
"with_feature_set",
3132
)
32-
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
3333

3434
def _target_os_version(ctx):
3535
platform_type = ctx.fragments.apple.single_arch_platform.platform_type
@@ -1286,7 +1286,9 @@ def _impl(ctx):
12861286
),
12871287
flag_set(
12881288
actions = all_link_actions,
1289-
flag_groups = [flag_group(flags = ["-Wl,-fatal-warnings"])],
1289+
flag_groups = [flag_group(
1290+
flags = ["-Wl,-fatal-warnings"] if is_linux else ["-Wl,-fatal_warnings"],
1291+
)],
12901292
),
12911293
],
12921294
)

0 commit comments

Comments
 (0)