Skip to content

Commit

Permalink
Add back android config_setting that looks for //external:android/cro…
Browse files Browse the repository at this point in the history
…sstool (#16127) (#16264)

In #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=#16127 from sifmelcara:add-back-legacy-crosstool-top c643235
PiperOrigin-RevId: 615449874

Co-authored-by: Ming-Chuan <[email protected]>
  • Loading branch information
acozzette and sifmelcara authored Mar 22, 2024
1 parent 1ffebb2 commit a97c927
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build_defs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,23 @@ 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 = {
"crosstool_top": "@platforms//os:android",
},
)

# 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 = {
Expand Down
1 change: 1 addition & 0 deletions build_defs/cpp_opts.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down

0 comments on commit a97c927

Please sign in to comment.