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 9 months ago committed by Copybara-Service
parent 0a930a1df7
commit e54174728f
  1. 10
      build_defs/BUILD.bazel
  2. 1
      build_defs/cpp_opts.bzl

@ -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 = {

@ -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": [],

Loading…
Cancel
Save