Skip to content

Commit

Permalink
Fix constraint_values for Windows MSVC.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 732906253
  • Loading branch information
Highway authored and copybara-github committed Mar 3, 2025
1 parent abe6999 commit 062085a
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,8 @@ config_setting(
)

config_setting(
name = "compiler_msvc_actual",
flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc"},
)

# The above is insufficient for Bazel on Windows, which does not seem to
# detect/set a compiler flag. This workaround prevents compile errors due to
# passing clang-only warning flags to MSVC.
config_setting(
name = "compiler_msvc_cpu",
values = {
"cpu": "x64_windows",
},
)

selects.config_setting_group(
name = "compiler_msvc",
match_any = [
":compiler_msvc_actual",
":compiler_msvc_cpu",
],
flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
)

config_setting(
Expand Down

0 comments on commit 062085a

Please sign in to comment.