mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
Link with -lrt for older glibc
Quoted from Linux Programmer's Manual (2017-09-15): #include <time.h> int clock_gettime(clockid_t clk_id, struct timespec *tp); Link with -lrt (only for glibc versions before 2.17). This patch adds additional checks for librt availability and append target_link_libraries accordingly. librt is absent on macOS. Fixed #139
This commit is contained in:
parent
7f29dec44a
commit
99e071cf2c
1 changed files with 4 additions and 0 deletions
|
@ -108,6 +108,10 @@ if(WIN32)
|
||||||
list(APPEND mi_libraries psapi shell32 user32)
|
list(APPEND mi_libraries psapi shell32 user32)
|
||||||
else()
|
else()
|
||||||
list(APPEND mi_libraries pthread)
|
list(APPEND mi_libraries pthread)
|
||||||
|
find_library(LIBRT rt)
|
||||||
|
if(LIBRT)
|
||||||
|
list(APPEND mi_libraries ${LIBRT})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue