瀏覽代碼

Merge pull request #1386 from andrewharp/patch-2

Do not link in pthread library for Android builds.
Feng Xiao 9 年之前
父節點
當前提交
f3fe75bae5
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      BUILD

+ 12 - 2
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({
+    ":android": [],
+    "//conditions:default": ["-lpthread"],
+})
 
 load(
     "protobuf",