Don't pass `-pthread` when building for WebAssembly.
Change-Id: I59c2e9598dfd48389ab72940e38372f2c324e41d
Reviewed-on: https://code-review.googlesource.com/c/re2/+/57250
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/BUILD b/BUILD
index 480646f..8a1a9c0 100644
--- a/BUILD
+++ b/BUILD
@@ -9,20 +9,20 @@
exports_files(["LICENSE"])
config_setting(
- name = "darwin",
+ name = "macos",
values = {"cpu": "darwin"},
)
config_setting(
+ name = "wasm",
+ values = {"cpu": "wasm"},
+)
+
+config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
)
-config_setting(
- name = "windows_msvc",
- values = {"cpu": "x64_windows_msvc"},
-)
-
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
cc_library(
@@ -75,17 +75,17 @@
"re2/stringpiece.h",
],
copts = select({
+ ":wasm": [],
":windows": [],
- ":windows_msvc": [],
"//conditions:default": ["-pthread"],
}),
linkopts = select({
- # Darwin doesn't need `-pthread' when linking and it appears that
+ # macOS 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": [],
+ ":macos": [],
+ ":wasm": [],
":windows": [],
- ":windows_msvc": [],
"//conditions:default": ["-pthread"],
}),
visibility = ["//visibility:public"],