From 0cfc3c161fac33cdbd5b0bab0c249f4bc95ed1ed Mon Sep 17 00:00:00 2001 From: Tayne <64623083+tayne3@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:49:36 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=F0=9F=9B=A0=EF=B8=8F=20=E6=94=B9?= =?UTF-8?q?=E8=BF=9B=20CMake=20=E4=B8=AD=20clock=5Fgettime=20=E7=9A=84?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E6=A3=80=E6=9F=A5=20(#623)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tayne --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ff30e60c..b5001e6df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,14 @@ check_function("socketpair" "sys/socket.h") check_function("eventfd" "sys/eventfd.h") check_function("setproctitle" "unistd.h") +if (NOT HAVE_CLOCK_GETTIME) + include(CheckLibraryExists) + check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME_IN_RT) + if (HAVE_CLOCK_GETTIME_IN_RT) + set(HAVE_CLOCK_GETTIME ${HAVE_CLOCK_GETTIME_IN_RT}) + endif() +endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hconfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/hconfig.h) # see Makefile.in