0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 06:41:03 +08:00

CMake: don't try to link with librt on MinGW

On MinGW, librt will might will found as rt library in MSYS, but fails linking with "cannot find -lrt" error.
As librt is not avaiable on native Windows, we should never try to link with -lrt on MinGW (which is native Windows).
This commit is contained in:
skicc 2019-06-15 21:48:32 +08:00 committed by GitHub
parent 9534bbfc4d
commit d2be018800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -362,9 +362,11 @@ else()
check_cxx_symbol_exists(LOCAL_PEERCRED sys/socket.h ZMQ_HAVE_LOCAL_PEERCRED)
endif()
find_library(RT_LIBRARY rt)
if(RT_LIBRARY)
set(pkg_config_libs_private "${pkg_config_libs_private} -lrt")
if(NOT MINGW)
find_library(RT_LIBRARY rt)
if(RT_LIBRARY)
set(pkg_config_libs_private "${pkg_config_libs_private} -lrt")
endif()
endif()
find_package(Threads)