Omit -pthread option on Darwin

The copy of Clang shipped with XCode 9.2 emits a warning when this
option is passed.

"clang: warning: argument unused during compilation:
'-pthread' [-Wunused-command-line-argument]"

This makes the build log very noisy, since the warning is emitted
for libre2 and every test.

Change-Id: I7714e08f66b51a86061016cae26f9b8b4f75ad9a
Reviewed-on: https://code-review.googlesource.com/23791
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/BUILD b/BUILD
index dd261b1..e09518c 100644
--- a/BUILD
+++ b/BUILD
@@ -9,6 +9,11 @@
 exports_files(["LICENSE"])
 
 config_setting(
+    name = "darwin",
+    values = {"cpu": "darwin"},
+)
+
+config_setting(
     name = "windows",
     values = {"cpu": "x64_windows"},
 )
@@ -73,6 +78,10 @@
         "//conditions:default": ["-pthread"],
     }),
     linkopts = select({
+        # Darwin doesn't need `-pthread' when linking and it appears that
+        # older versions of Clang will warn about the unused command line
+        # argument, so just don't pass it.
+        ":darwin": [],
         ":windows": [],
         ":windows_msvc": [],
         "//conditions:default": ["-pthread"],