From e1736b97037c032e7845b0499752675c00156602 Mon Sep 17 00:00:00 2001 From: Armando Montanez Date: Wed, 18 Dec 2024 09:49:45 -0800 Subject: [PATCH] pw_toolchain: Transition flag to update rules_cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds temporary migration flag so rules_cc can be updated across downstream projects. Bug: b/384050813 Change-Id: I9df89a45d858e29d9537cd02bdfac654f284dbf1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/254432 Lint: Lint 🤖 Commit-Queue: Auto-Submit Docs-Not-Needed: Armando Montanez Presubmit-Verified: CQ Bot Account Reviewed-by: Ted Pudlik Pigweed-Auto-Submit: Armando Montanez --- pw_toolchain/host_clang/BUILD.bazel | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/pw_toolchain/host_clang/BUILD.bazel b/pw_toolchain/host_clang/BUILD.bazel index 945ee9e6e..b83c26d65 100644 --- a/pw_toolchain/host_clang/BUILD.bazel +++ b/pw_toolchain/host_clang/BUILD.bazel @@ -248,8 +248,37 @@ cc_args( ) cc_feature( - name = "supports_pic", + name = "supports_pic_old", overrides = "@rules_cc//cc/toolchains/features:supports_pic", + visibility = ["//visibility:private"], +) + +# TODO: https://pwbug.dev/384050813 - This flag is a temporary transition flag +# that will be removed shortly. +bool_flag( + name = "new_rules_cc", + build_setting_default = False, +) + +config_setting( + name = "rules_cc_post_0.0.10", + flag_values = { + ":new_rules_cc": "True", + }, +) + +cc_feature( + name = "supports_pic_actual", + feature_name = "supports_pic", + visibility = ["//visibility:private"], +) + +alias( + name = "supports_pic", + actual = select({ + ":rules_cc_post_0.0.10": "supports_pic_actual", + "//conditions:default": "supports_pic_old", + }), ) # Symlink to clangd, for user convenience.