Skip to content

Commit

Permalink
Add Android stlport and default toolchains to BUILD.
Browse files Browse the repository at this point in the history
These are additional possibilities for --crosstool_top for Android NDK
compilation. Since the NDK doesn't have -lpthread, getting these flags
wrong leads to a linker error.

Fixes: 180084220
  • Loading branch information
blueshiftlabs committed Feb 12, 2021
1 parent aee143a commit cd38c35
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions BUILD
Expand Up @@ -111,6 +111,17 @@ config_setting(
],
)

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

config_setting(
name = "android-libcpp",
values = {
Expand All @@ -133,11 +144,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

0 comments on commit cd38c35

Please sign in to comment.