Add back android config_setting that looks for //external:android/crosstool (#16127)

In https://github.com/protocolbuffers/protobuf/pull/15298 `"crosstool_top": "//external:android/crosstool"` was replaced with `"crosstool_top": "@platforms//os:android"`. This breaks users who have not migrated to https://bazel.build/concepts/platforms yet.

Closes #16127

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16127 from sifmelcara:add-back-legacy-crosstool-top c643235a3d
PiperOrigin-RevId: 615449874
pull/16138/head
Ming-Chuan 2024-03-13 09:42:33 -07:00 committed by Copybara-Service
parent 0a930a1df7
commit e54174728f
2 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@ config_setting(
# For more info on the various crosstool_tops used by NDK Bazel builds, see:
# https://docs.bazel.build/versions/master/android-ndk.html#configuring-the-stl
# When using https://bazel.build/concepts/platforms
config_setting(
name = "config_android",
values = {
@ -42,6 +43,15 @@ config_setting(
},
)
# When using legacy flags like --android_crosstool_top, --android_cpu, and --fat_apk_cpu
config_setting(
name = "config_android-legacy-default-crosstool",
values = {
# Default of `--android_crosstool_top`
"crosstool_top": "//external:android/crosstool",
},
)
config_setting(
name = "config_android-stlport",
values = {

View File

@ -29,6 +29,7 @@ COPTS = select({
# Android and MSVC builds do not need to link in a separate pthread library.
LINK_OPTS = select({
"//build_defs:config_android": [],
"//build_defs:config_android-legacy-default-crosstool": [],
"//build_defs:config_android-stlport": [],
"//build_defs:config_android-libcpp": [],
"//build_defs:config_android-gnu-libstdcpp": [],