--- Source/cmSystemTools.cxx.orig	2024-04-01 07:17:19.000000000 -0700
+++ Source/cmSystemTools.cxx	2024-04-01 07:37:51.000000000 -0700
@@ -17,6 +17,13 @@
 #  define _DARWIN_C_SOURCE
 #endif
 
+#if defined(__APPLE__)
+# include <AvailabilityMacros.h>
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+# undef _POSIX_C_SOURCE
+# endif
+# endif
+
 #include "cmSystemTools.h"
 
 #include <cm/optional>
