aboutsummaryrefslogtreecommitdiff
path: root/BUILD
diff options
context:
space:
mode:
authorAndrew Harp <andrewharp@users.noreply.github.com>2016-04-04 15:13:30 -0400
committerAndrew Harp <andrewharp@users.noreply.github.com>2016-04-04 15:13:30 -0400
commitb56b461e4918992bfe122e7596f8620dcc3dd6de (patch)
tree7d82cae1c64d4999732a811c2a5d7ecb51a6836b /BUILD
parenta771c9e11c4cd0350db9e7fbae977e9aeea468b8 (diff)
downloadprotobuf-b56b461e4918992bfe122e7596f8620dcc3dd6de.tar.gz
protobuf-b56b461e4918992bfe122e7596f8620dcc3dd6de.tar.bz2
protobuf-b56b461e4918992bfe122e7596f8620dcc3dd6de.zip
Do not link in pthread library for Android builds.
This is required to allow Tensorflow to build on Android without hacks. Currently we create a dummy pthread library just to satisfy this dependency for a library that does not exist on Android. See https://github.com/google/protobuf/issues/1373 for more context.
Diffstat (limited to 'BUILD')
-rw-r--r--BUILD14
1 files changed, 12 insertions, 2 deletions
diff --git a/BUILD b/BUILD
index e35a2e8e..03582503 100644
--- a/BUILD
+++ b/BUILD
@@ -15,8 +15,18 @@ COPTS = [
"-Wno-error=unused-function",
]
-# Bazel should provide portable link_opts for pthread.
-LINK_OPTS = ["-lpthread"]
+config_setting(
+ name = "android",
+ values = {
+ "crosstool_top": "//external:android/crosstool",
+ },
+)
+
+# Android builds do not need to link in a separate pthread library.
+LINK_OPTS = select({
+ "//tensorflow:android": [],
+ "//conditions:default": ["-lpthread"],
+})
load(
"protobuf",