Skip to content

Commit

Permalink
Fix -fatal_warnings on macOS
Browse files Browse the repository at this point in the history
Fixes #20919

Closes #20924.

PiperOrigin-RevId: 601022242
Change-Id: I257023dcf9983cb2b3ce16079675f6b5f9409b86
  • Loading branch information
keith authored and copybara-github committed Jan 24, 2024
1 parent 7d9f07f commit 3d7c5ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/cpp/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""A Starlark cc_toolchain configuration rule"""

load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
Expand All @@ -29,7 +30,6 @@ load(
"variable_with_value",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")

def _target_os_version(ctx):
platform_type = ctx.fragments.apple.single_arch_platform.platform_type
Expand Down Expand Up @@ -1286,7 +1286,9 @@ def _impl(ctx):
),
flag_set(
actions = all_link_actions,
flag_groups = [flag_group(flags = ["-Wl,-fatal-warnings"])],
flag_groups = [flag_group(
flags = ["-Wl,-fatal-warnings"] if is_linux else ["-Wl,-fatal_warnings"],
)],
),
],
)
Expand Down

0 comments on commit 3d7c5ae

Please sign in to comment.