]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake: detect librt for POSIX time functions 31543/head
authorKefu Chai <kchai@redhat.com>
Mon, 11 Nov 2019 22:55:40 +0000 (06:55 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 14 Nov 2019 13:26:57 +0000 (21:26 +0800)
commitd6998a3b95c45d4a5f8ff433d9ee4cf96316f274
treeae729b912e9de151a492868ab82e3d91f41ecf21
parent7ffb5d9e79207da81af933f4e95655e16558c739
cmake: detect librt for POSIX time functions

per clock_gettime(3),

> On POSIX systems on which these functions are available, the symbol
> _POSIX_TIMERS is defined in <unistd.h> to a value greater than 0.

and

> Most systems require the program be linked with the librt library to
> use these functions.

so, we should detect this symbol and link against librt for using these
functions.

in this change, librt is linked for checking the existence of
clock_gettime(), if it exists. RT_LIBRARY is defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/CephChecks.cmake
src/CMakeLists.txt