Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Android stlport and default toolchains to BUILD. #8290

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions BUILD
Expand Up @@ -69,6 +69,13 @@ create_compiler_config_setting(
],
)

# Android NDK builds can specify different crosstool_top flags to choose which
# STL they use for C++. We need these multiple variants to catch all of those
# versions of crosstool_top and reliably detect Android.
#
# 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

config_setting(
name = "android",
values = {
Expand All @@ -80,6 +87,17 @@ config_setting(
],
)

config_setting(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a comment with a link to https://docs.bazel.build/versions/master/android-ndk.html#configuring-the-stl ?

I think it probably makes sense to insert above this config_setting rule, with a note that it applies to several of them.

name = "android-stlport",
values = {
"crosstool_top": "@androidndk//:toolchain-stlport",
},
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
)

config_setting(
name = "android-libcpp",
values = {
Expand All @@ -102,11 +120,24 @@ config_setting(
],
)

config_setting(
name = "android-default",
values = {
"crosstool_top": "@androidndk//:default_crosstool",
},
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
)

# Android and MSVC builds do not need to link in a separate pthread library.
LINK_OPTS = select({
":android": [],
":android-stlport": [],
":android-libcpp": [],
":android-gnu-libstdcpp": [],
":android-default": [],
":msvc": [
# Suppress linker warnings about files with no symbols defined.
"-ignore:4221",
Expand Down