From c71d35d4d992f60f24f91d4689522ec2709df1b7 Mon Sep 17 00:00:00 2001 From: Aaron Dierking Date: Tue, 10 Jul 2018 17:08:57 -0700 Subject: [PATCH] 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. --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6b95a9b82..6eaf8c7c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -191,6 +191,9 @@ endif() if(BSD_OVERLAY_FOUND) target_link_libraries(dispatch PRIVATE ${BSD_OVERLAY_LDFLAGS}) endif() +if(LibRT_FOUND) + target_link_libraries(dispatch PRIVATE RT::rt) +endif() target_link_libraries(dispatch PRIVATE Threads::Threads