CMAKE: sem_timedwait is found in pthread on newer linuxes
This commit is contained in:
parent
a3947f5a26
commit
e296c98a7e
|
@ -126,11 +126,19 @@ ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VE
|
||||||
ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='')
|
ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='')
|
||||||
|
|
||||||
if( ENABLE_LINK )
|
if( ENABLE_LINK )
|
||||||
|
# IPC linking code needs sem_timedwait which can be either in librt or pthreads
|
||||||
FIND_LIBRARY(RT_LIB rt)
|
FIND_LIBRARY(RT_LIB rt)
|
||||||
IF(RT_LIB)
|
IF(RT_LIB)
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES ${RT_LIB})
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${RT_LIB})
|
||||||
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${RT_LIB})
|
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${RT_LIB})
|
||||||
ENDIF(RT_LIB)
|
ENDIF(RT_LIB)
|
||||||
|
|
||||||
|
FIND_LIBRARY(PTHREAD_LIB pthread)
|
||||||
|
IF(PTHREAD_LIB)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${PTHREAD_LIB})
|
||||||
|
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${PTHREAD_LIB})
|
||||||
|
ENDIF(PTHREAD_LIB)
|
||||||
|
|
||||||
INCLUDE(CheckFunctionExists)
|
INCLUDE(CheckFunctionExists)
|
||||||
CHECK_FUNCTION_EXISTS(sem_timedwait SEM_TIMEDWAIT)
|
CHECK_FUNCTION_EXISTS(sem_timedwait SEM_TIMEDWAIT)
|
||||||
IF( SEM_TIMEDWAIT)
|
IF( SEM_TIMEDWAIT)
|
||||||
|
|
Loading…
Reference in New Issue