cmake: fix build error with Xcode 9 on macOS 12
authorFelix Fietkau <nbd@nbd.name>
Thu, 5 Oct 2017 18:44:52 +0000 (20:44 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Oct 2017 19:16:25 +0000 (21:16 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
tools/cmake/patches/010-backport-macos-fix.patch [new file with mode: 0644]

diff --git a/tools/cmake/patches/010-backport-macos-fix.patch b/tools/cmake/patches/010-backport-macos-fix.patch
new file mode 100644 (file)
index 0000000..76e92dc
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
++++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
+@@ -265,6 +265,12 @@ int main()
+ #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#if defined(__APPLE__)
++#include <AvailabilityMacros.h>
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
++#error "utimensat not available on macOS < 10.13"
++#endif
++#endif
+ int main()
+ {
+   struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };