diff --git a/libsrc/leddevice/CMakeLists.txt b/libsrc/leddevice/CMakeLists.txt index 82be7df2..4da16a1d 100644 --- a/libsrc/leddevice/CMakeLists.txt +++ b/libsrc/leddevice/CMakeLists.txt @@ -139,6 +139,22 @@ if (ENABLE_DEV_USB_HID) else() target_link_libraries(leddevice ${LIBUSB_1_LIBRARIES} hidapi-libusb) endif() + if(NOT WIN32) + include(CheckCSourceCompiles) + # Glibc compatibilty check + check_c_source_compiles(" + #include + #include + + int main() { + struct timespec t; + return clock_gettime(CLOCK_REALTIME, &t); + } + " GLIBC_HAS_CLOCK_GETTIME) + IF(NOT GLIBC_HAS_CLOCK_GETTIME) + target_link_libraries(leddevice rt) + endif() + endif() endif() if(ENABLE_MDNS)