mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 08:51:13 +00:00
Merge pull request #2130 from worblehat/development
Check if librt exists independent of OS, to be able to exclude librt on ...
This commit is contained in:
commit
5af69ee96a
@ -17,6 +17,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|||||||
# Add find modules to the path
|
# Add find modules to the path
|
||||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/")
|
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/")
|
||||||
|
|
||||||
|
INCLUDE(CheckLibraryExists)
|
||||||
|
|
||||||
# Build options
|
# Build options
|
||||||
#
|
#
|
||||||
OPTION( SONAME "Set the (SO)VERSION of the target" ON )
|
OPTION( SONAME "Set the (SO)VERSION of the target" ON )
|
||||||
@ -78,7 +80,9 @@ FUNCTION(TARGET_OS_LIBRARIES target)
|
|||||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
||||||
TARGET_LINK_LIBRARIES(${target} socket nsl)
|
TARGET_LINK_LIBRARIES(${target} socket nsl)
|
||||||
SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lsocket -lnsl" PARENT_SCOPE)
|
SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lsocket -lnsl" PARENT_SCOPE)
|
||||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
ENDIF()
|
||||||
|
CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" NEED_LIBRT)
|
||||||
|
IF(NEED_LIBRT)
|
||||||
TARGET_LINK_LIBRARIES(${target} rt)
|
TARGET_LINK_LIBRARIES(${target} rt)
|
||||||
SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
|
SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
Loading…
Reference in New Issue
Block a user