cmake: do not link against librt on osx

as osx does not offer librt

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-09-10 00:48:37 +08:00
parent 4c9085b3d8
commit 21e90b94ab

View File

@ -170,7 +170,10 @@ if(COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=${DIAGNOSTICS_COLOR}")
endif()
set(EXTRALIBS rt ${CMAKE_DL_LIBS} ${ATOMIC_OPS_LIBRARIES})
set(EXTRALIBS ${CMAKE_DL_LIBS} ${ATOMIC_OPS_LIBRARIES})
if(NOT APPLE)
list(APPEND EXTRALIBS rt)
endif()
if(LINUX)
set(LIB_RESOLV resolv)
list(APPEND EXTRALIBS ${LIB_RESOLV})