1 From 1bc450179a0819970261e6a29071756d09b71c5f Mon Sep 17 00:00:00 2001
2 From: Paul Cercueil <paul.cercueil@analog.com>
3 Date: Fri, 19 Aug 2016 09:00:58 +0200
4 Subject: [PATCH] CMake: Link with librt if found
6 This is required for older versions of glibc.
8 Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
10 CMakeLists.txt | 4 ++++
11 1 file changed, 4 insertions(+)
13 diff --git a/CMakeLists.txt b/CMakeLists.txt
14 index 2a339fe..3dd3520 100644
17 @@ -113,6 +113,10 @@ add_definitions(-DLIBIIO_VERSION_GIT="${LIBIIO_VERSION_GIT}")
18 if(WITH_LOCAL_BACKEND)
19 add_definitions(-DLOCAL_BACKEND=1)
20 set(LIBIIO_CFILES ${LIBIIO_CFILES} local.c)
22 + # Link with librt if present
23 + find_library(LIBRT_LIBRARIES rt)
24 + set(LIBS_TO_LINK ${LIBS_TO_LINK} ${LIBRT_LIBRARIES})
27 find_library(LIBUSB_LIBRARIES usb-1.0)