Skip to content

Commit 8dbefa2

Browse files
committed
fix: compile pthreadpool successfully on Windows
1 parent ec49372 commit 8dbefa2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ http_archive(
218218
# pthreadpool is a dependency of XNNPACK, from 2025-04-02
219219
http_archive(
220220
name = "pthreadpool",
221+
patch_args = [
222+
"-p1",
223+
],
224+
patches = [
225+
"@//third_party:pthreadpool.patch",
226+
],
221227
# `curl -L <url> | shasum -a 256`
222228
sha256 = "745e56516d6a58d183eb33d9017732d87cff43ce9f78908906f9faa52633e421",
223229
strip_prefix = "pthreadpool-b92447772365661680f486e39a91dfe6675adafc",

third_party/pthreadpool.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/BUILD.bazel b/BUILD.bazel
2+
index 396537f..081a0a2 100644
3+
--- a/BUILD.bazel
4+
+++ b/BUILD.bazel
5+
@@ -67,9 +67,11 @@ cc_library(
6+
hdrs = [
7+
"include/pthreadpool.h",
8+
],
9+
- copts = [
10+
- "-std=c11",
11+
- ] + select({
12+
+ copts = select({
13+
+ ":windows_x86_64": ["/std:c11", "/experimental:c11atomics"],
14+
+ ":windows_arm64": ["/std:c11", "/experimental:c11atomics"],
15+
+ "//conditions:default": ["-std=c11"],
16+
+ }) + select({
17+
":optimized_build": ["-O2"],
18+
"//conditions:default": [],
19+
}) + select({

0 commit comments

Comments
 (0)