summaryrefslogtreecommitdiff
path: root/Utilities/cmlibarchive
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-20 10:19:38 -0400
committerBrad King <brad.king@kitware.com>2017-09-20 11:28:40 -0400
commit96329d5dffdd5a22c5b4428119b5d3762a8857a7 (patch)
treecd6ee5f8daeef6ca9f2e09885addb12cf045a4a7 /Utilities/cmlibarchive
parent28cbfe151944a85a227ea5c41b76fa0621ac707b (diff)
downloadcmake-96329d5dffdd5a22c5b4428119b5d3762a8857a7.tar.gz
libarchive: Do not use nanosecond file time APIs on macOS < 10.13
The SDK for macOS 10.13 adds `futimens` and `utimensat` so our checks for these symbols may pass. However, the symbols are not available at runtime on older macOS versions. Instead on macOS we can check for availability based on the deployment target version. Issue: #17101
Diffstat (limited to 'Utilities/cmlibarchive')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_platform.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_platform.h b/Utilities/cmlibarchive/libarchive/archive_platform.h
index 4cb8f81786..f33208c9aa 100644
--- a/Utilities/cmlibarchive/libarchive/archive_platform.h
+++ b/Utilities/cmlibarchive/libarchive/archive_platform.h
@@ -52,6 +52,17 @@
#error Oops: No config.h and no pre-built configuration in archive_platform.h.
#endif
+/* On macOS check for some symbols based on the deployment target version. */
+#if defined(__APPLE__)
+# undef HAVE_FUTIMENS
+# undef HAVE_UTIMENSAT
+# include <AvailabilityMacros.h>
+# if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+# define HAVE_FUTIMENS 1
+# define HAVE_UTIMENSAT 1
+# endif
+#endif
+
/* It should be possible to get rid of this by extending the feature-test
* macros to cover Windows API functions, probably along with non-trivial
* refactoring of code to find structures that sit more cleanly on top of