Skip to content

Commit 5c7c60b

Browse files
author
Hugh Delaney
committed
Only add flag if using pthreads
1 parent b261fd9 commit 5c7c60b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/loader/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ if (UNIX)
5151
# Older gcc versions need -pthread, not just -lpthread
5252
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
5353
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.1)
54-
find_library(PTHREAD_LIBRARY REQUIRED pthread)
55-
target_link_libraries(ur_loader PRIVATE "-pthread")
54+
if(CMAKE_USE_PTHREADS_INIT)
55+
target_link_libraries(ur_loader PRIVATE "-pthread")
56+
endif()
5657
endif()
5758
endif()
5859
endif()

0 commit comments

Comments
 (0)