From cd38c353ec3284e3549b8943b457a095658afb16 Mon Sep 17 00:00:00 2001 From: Justin Paupore Date: Fri, 12 Feb 2021 09:54:42 +0000 Subject: [PATCH] Add Android stlport and default toolchains to BUILD. 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 --- BUILD | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/BUILD b/BUILD index 1124321602b5..25daf91813b7 100644 --- a/BUILD +++ b/BUILD @@ -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 = { @@ -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",