Skip to content

Commit fb72962

Browse files
committed
comgr: Detect and link pthreads and rt correctly
Fixes the build on systems without rt library Change-Id: I2104cc457a1c1e28ec693dfad3bfc1ca36b7f7aa
1 parent f7621cf commit fb72962

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

amd/comgr/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,18 @@ if (NOT UNIX)
405405
PRIVATE version)
406406
endif()
407407

408+
find_package(Threads)
409+
target_link_libraries(amd_comgr PRIVATE ${CMAKE_THREAD_LIBS_INIT})
410+
411+
find_library(LIBRT rt)
412+
if(LIBRT)
413+
target_link_libraries(amd_comgr PRIVATE ${LIBRT})
414+
endif()
415+
416+
408417
if (NOT WIN32)
409418
target_link_libraries(amd_comgr
410419
PRIVATE
411-
pthread
412-
rt
413420
c
414421
${CMAKE_DL_LIBS})
415422
endif()

0 commit comments

Comments
 (0)