mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
cmake: detect HAVE_CLOCK_GETTIME_MONOTONIC_RAW
Based on existing autotools logic. Ref: #11964 (effort to sync cmake detections with autotools) Closes #11981
This commit is contained in:
parent
04a3a377d8
commit
da5dcb7007
@ -200,3 +200,22 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
|
||||
|
||||
set(_source_epilogue "${_save_epilogue}")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
|
||||
set(_save_epilogue "${_source_epilogue}")
|
||||
set(_source_epilogue "#undef inline")
|
||||
|
||||
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
|
||||
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
#include <time.h>
|
||||
int main(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
|
||||
return 0;
|
||||
}" HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
|
||||
|
||||
set(_source_epilogue "${_save_epilogue}")
|
||||
endif()
|
||||
|
@ -103,6 +103,7 @@ if(NOT UNIX)
|
||||
set(HAVE_GETEUID 0)
|
||||
set(HAVE_UTIME 1)
|
||||
set(HAVE_GMTIME_R 0)
|
||||
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 0)
|
||||
set(HAVE_GETHOSTBYNAME_R 0)
|
||||
set(HAVE_SIGNAL 1)
|
||||
set(HAVE_LINUX_TCP_H 0)
|
||||
|
@ -186,6 +186,10 @@
|
||||
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||
#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC 1
|
||||
|
||||
/* Define to 1 if you have the clock_gettime function and raw monotonic timer.
|
||||
*/
|
||||
#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1
|
||||
|
||||
/* Define to 1 if you have the `closesocket' function. */
|
||||
#cmakedefine HAVE_CLOSESOCKET 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user