rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit 6e4071147db8b3d92edf84463b765fa488942abb
parent 502598154ae31caf3ba2e2b560f691f99d341553
Author: vaplv <vaplv@free.fr>
Date:   Mon, 29 Jan 2018 09:43:25 +0100

Link with rt if RSys is using a GLibc version before 2.17

Diffstat:
Mcmake/CMakeLists.txt | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -133,7 +133,7 @@ add_library(rsys SHARED ${RSYS_FILES_SRC_THREAD} ${RSYS_FILES_INC} ${RSYS_FILES_INC_API}) -set_target_properties(rsys +set_target_properties(rsys PROPERTIES DEFINE_SYMBOL RSYS_SHARED_BUILD DEFINE_SYMBOL RSYS_SHARED_BUILD VERSION ${VERSION} @@ -145,6 +145,14 @@ if(CMAKE_COMPILER_IS_GNUCC) if(NOT MINGW) target_link_libraries(rsys dl) endif() + + # On GLIBC version before 2.17 one has to link with the "rt" library to use + # the clock_gettime function. + find_package(PkgConfig REQUIRED) + pkg_check_modules(GLIBC QUIET glib-2.0) + if(${GLIBC_FOUND} AND "${GLIBC_VERSION}" VERSION_LESS "2.17") + target_link_libraries(rsys rt) + endif() endif() rcmake_setup_devel(rsys RSys ${VERSION} rsys/rsys_version.h)