Fix building on OpenBSD (#6637)

Only utilize librt if its presence is detected.
This commit is contained in:
Brad Smith
2023-06-06 01:04:51 -04:00
committed by GitHub
parent af59a9cfae
commit 503d558e90
+4 -1
View File
@@ -275,7 +275,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
set(MAYBE_RT_LIBRARY -lrt) find_library(RT_LIB rt)
if (RT_LIB)
set(MAYBE_RT_LIBRARY -lrt)
endif()
endif() endif()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)