From 063799a116be33cf786efaf2be2cd731c3a107f5 Mon Sep 17 00:00:00 2001 From: Anatoly Kamchatnov Date: Sun, 8 Jan 2017 00:00:29 +0300 Subject: [PATCH] Fix build on OpenBSD OpenBSD lacks librt, but provides its functionality in base libc. --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 448c7f791..c1fc62ae5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,11 +199,13 @@ endif() # Find and add Unix math and time libraries #-------------------------------------------------------------------- if (UNIX AND NOT APPLE) - find_library(RT_LIBRARY rt) - mark_as_advanced(RT_LIBRARY) - if (RT_LIBRARY) - list(APPEND glfw_LIBRARIES "${RT_LIBRARY}") - list(APPEND glfw_PKG_LIBS "-lrt") + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") + find_library(RT_LIBRARY rt) + mark_as_advanced(RT_LIBRARY) + if (RT_LIBRARY) + list(APPEND glfw_LIBRARIES "${RT_LIBRARY}") + list(APPEND glfw_PKG_LIBS "-lrt") + endif() endif() find_library(MATH_LIBRARY m)