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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -275,7 +275,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
endif()
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()
find_package(Threads REQUIRED)