From 182a55bfee38ab9d2804d86fd1e8bc43fcf08389 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Wed, 27 Nov 2024 00:11:33 +0800
Subject: [PATCH 3/3] timerfd-root-test: skip on macOS < 10.12

---
 test/CMakeLists.txt | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2d04d2a..5f3c9f8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -15,6 +15,14 @@ include(ATFTest)
 set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
 
+if(APPLE)
+  exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
+  string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
+  if(DARWIN_VERSION LESS 16)
+    set(APPLE_LEGACY 1)
+  endif()
+endif()
+
 #
 
 macro(atf_test_impl _testname _suffix)
@@ -54,7 +62,9 @@ foreach(_target epoll-test epoll-test-interpose epoll-test-rdhup-linux-def)
   endif()
 endforeach()
 atf_test(timerfd-test)
-atf_test(timerfd-root-test)
+if(NOT APPLE_LEGACY)
+  atf_test(timerfd-root-test)
+endif()
 atf_test(timerfd-mock-test)
 atf_test(signalfd-test)
 atf_test(perf-many-fds)
-- 
2.47.1

