Skip to content

Commit 35b36c6

Browse files
committed
Add lib threads to umf_utils
1 parent 51d9aa4 commit 35b36c6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

benchmark/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
include(FindThreads)
6+
57
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
68
message(WARNING "The ubench SHOULD NOT be run in the Debug build type!")
79
endif()
@@ -29,7 +31,7 @@ target_include_directories(ubench PRIVATE ${UMF_CMAKE_SOURCE_DIR}/include/)
2931
target_link_libraries(ubench
3032
umf
3133
${LIBS_OPTIONAL}
32-
pthread
34+
${CMAKE_THREAD_LIBS_INIT}
3335
m)
3436

3537
if (UMF_BUILD_OS_MEMORY_PROVIDER)

src/utils/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

55
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
6+
include(FindThreads)
67

78
set(UMF_UTILS_SOURCES_POSIX
89
utils_posix_concurrency.c
@@ -22,7 +23,8 @@ endif()
2223

2324
add_umf_library(NAME umf_utils
2425
TYPE STATIC
25-
SRCS ${UMF_UTILS_SOURCES})
26+
SRCS ${UMF_UTILS_SOURCES}
27+
LIBS ${CMAKE_THREAD_LIBS_INIT})
2628

2729
add_library(${PROJECT_NAME}::utils ALIAS umf_utils)
2830

0 commit comments

Comments
 (0)