Skip to content

Commit 7638387

Browse files
committed
fix: use threads if not wasm
1 parent 3c4f328 commit 7638387

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
314314
# <aztec>
315315
# aztec google-benchmark change: We have threads available in wasi-threads but can't call find_package(THREADS)
316316
# This works around us being able to call benchmarks in wasmtime.
317-
# # Ensure we have pthreads
318-
# find_package(Threads REQUIRED)
317+
# Original comment: Ensure we have pthreads
318+
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "wasm32")
319+
find_package(Threads REQUIRED)
320+
endif()
319321
# </aztec>
320322
cxx_feature_check(PTHREAD_AFFINITY)
321323

src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ endif()
4242
# <aztec>
4343
# aztec google-benchmark change: We have threads available in wasi-threads but can't call find_package(THREADS)
4444
# This works around us being able to call benchmarks in wasmtime.
45-
## Link threads.
46-
# target_link_libraries(benchmark PRIVATE Threads::Threads)
45+
# Original comment: Link threads.
46+
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "wasm32")
47+
target_link_libraries(benchmark PRIVATE Threads::Threads)
48+
endif()
4749
# </aztec>
4850

4951
target_link_libraries(benchmark PRIVATE ${BENCHMARK_CXX_LIBRARIES})

0 commit comments

Comments
 (0)