From c6792f78df9807cd30b95365df40c0524a5f122c Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 13 Feb 2023 21:47:14 +0300 Subject: [PATCH] look for clock_gettime() in libc first, then in librt if not found. --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1c226b67..26fd4a9f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1612,14 +1612,14 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) CheckPTHREAD() if(SDL_CLOCK_GETTIME) - check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT) - if(FOUND_CLOCK_GETTIME_LIBRT) - list(APPEND SDL_EXTRA_LIBS rt) + check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC) + if(FOUND_CLOCK_GETTIME_LIBC) set(HAVE_CLOCK_GETTIME 1) else() - check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC) - if(FOUND_CLOCK_GETTIME_LIBC) + check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT) + if(FOUND_CLOCK_GETTIME_LIBRT) set(HAVE_CLOCK_GETTIME 1) + list(APPEND SDL_EXTRA_LIBS rt) endif() endif() endif()