SDL: cmake: make sure check_* uses 2 different variables for clock_gettime

From 2f9c9b5f80e0a19d7b7dabc4504f08c0ebd65140 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 27 Sep 2022 02:30:43 +0200
Subject: [PATCH] cmake: make sure check_* uses 2 different variables for
 clock_gettime

---
 CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebc78351eba..4f062247c5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1536,13 +1536,13 @@ 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)
-    if(FOUND_CLOCK_GETTIME)
+    check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT)
+    if(FOUND_CLOCK_GETTIME_LIBRT)
       list(APPEND EXTRA_LIBS rt)
       set(HAVE_CLOCK_GETTIME 1)
     else()
-      check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME)
-      if(FOUND_CLOCK_GETTIME)
+      check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC)
+      if(FOUND_CLOCK_GETTIME_LIBC)
         set(HAVE_CLOCK_GETTIME 1)
       endif()
     endif()