Skip to content

Commit 3b932cb

Browse files
adierkingktopley-apple
authored andcommitted
build: link against librt if it's available
CMakeLists.txt checks for librt's presence but the result is never used. This causes a link failure on systems where clock_gettime() is provided by librt. Signed-off-by: Kim Topley <ktopley@apple.com>
1 parent 79b30ad commit 3b932cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ endif()
191191
if(BSD_OVERLAY_FOUND)
192192
target_link_libraries(dispatch PRIVATE ${BSD_OVERLAY_LDFLAGS})
193193
endif()
194+
if(LibRT_FOUND)
195+
target_link_libraries(dispatch PRIVATE RT::rt)
196+
endif()
194197
target_link_libraries(dispatch
195198
PRIVATE
196199
Threads::Threads

0 commit comments

Comments
 (0)