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

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

Co-authored-by: Ming-Chuan <wtvwtvwtv2008@gmail.com>
pull/16271/head
Adam Cozzette 8 months ago committed by GitHub
parent 1ffebb2e37
commit a97c927b51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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