Merge pull request #4824 from DoDoENT:fix/emscripten-without-threads

PiperOrigin-RevId: 967351125
Change-Id: I4637dd19dfbd8c39d31a4a2bb6f4068e0f631e15
This commit is contained in:
Copybara-Service 2026-08-19 12:35:58 -07:00
commit 0daf775f8c
1 changed files with 13 additions and 0 deletions

View File

@ -58,6 +58,16 @@ config_setting(
constraint_values = ["@platforms//os:openbsd"],
)
config_setting(
name = "emscripten_without_threads",
constraint_values = [
"@platforms//os:emscripten",
],
values = {
"features": "-use_pthreads",
},
)
# NOTE: Fuchsia is not an officially supported platform.
config_setting(
name = "fuchsia",
@ -113,10 +123,12 @@ cc_library(
copts = select({
":qnx": [],
":windows": [],
":emscripten_without_threads": [],
"//conditions:default": ["-pthread"],
}),
defines = select({
":has_absl": ["GTEST_HAS_ABSL=1"],
":emscripten_without_threads": ["GTEST_HAS_PTHREAD=0"],
"//conditions:default": [],
}),
features = select({
@ -140,6 +152,7 @@ cc_library(
"-lm",
"-pthread",
],
":emscripten_without_threads": [],
"//conditions:default": ["-pthread"],
}),
deps = select({