From 4145e259c28184a050e8f4d1dd21aa67384f4ad4 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 3 May 2024 22:55:26 -0700 Subject: [PATCH] Fix #10007: Propagate msvc-style link flags to clang-cl with Bazel The idea here is to set the existing config "config_msvc" not only when "msvc-cl" is specified but also when "clang-cl" is specified. Keep in mind that clang-cl support in protobuf remains to be only best-effort and untested for now. PiperOrigin-RevId: 630590450 --- build_defs/BUILD.bazel | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build_defs/BUILD.bazel b/build_defs/BUILD.bazel index a0e0438d6ef9c..8745e1d6188a8 100644 --- a/build_defs/BUILD.bazel +++ b/build_defs/BUILD.bazel @@ -14,10 +14,24 @@ package( ) create_compiler_config_setting( - name = "config_msvc", + name = "config_msvc_cl", value = "msvc-cl", ) +# Caveat: clang-cl support in protobuf is only best-effort / untested for now. +create_compiler_config_setting( + name = "config_clang_cl", + value = "clang-cl", +) + +selects.config_setting_group( + name = "config_msvc", + match_any = [ + ":config_clang_cl", + ":config_msvc_cl", + ], +) + config_setting( name = "aarch64", values = {"cpu": "linux-aarch_64"},