summaryrefslogtreecommitdiff
path: root/CMake/macOSMaxAllowed.c
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-11-04 22:35:43 +0100
committerMatthias Melcher <github@matthiasm.com>2024-11-04 22:35:49 +0100
commita77cc0cb35455d12a84ccde1e7457345448a375c (patch)
tree8f3bae90da96c5e9149c0f2acdd9503c3b54a649 /CMake/macOSMaxAllowed.c
parent71a61d9cbfe4a82b08a7e2ae5adeb6b5353939e6 (diff)
MacOS version check using try_compile: #1103
This change will work as well when cross-compiling.
Diffstat (limited to 'CMake/macOSMaxAllowed.c')
-rw-r--r--CMake/macOSMaxAllowed.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/CMake/macOSMaxAllowed.c b/CMake/macOSMaxAllowed.c
index 625bcb6af..93fff3c3d 100644
--- a/CMake/macOSMaxAllowed.c
+++ b/CMake/macOSMaxAllowed.c
@@ -1,8 +1,6 @@
-#include <Availability.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- unsigned int ver = __MAC_OS_X_VERSION_MAX_ALLOWED;
- printf("%d.%d.%d", ver/10000, (ver/100)%100, ver%100);
- return 0;
-}
+#include <AvailabilityMacros.h>
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK
+#error __MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK
+#endif
+int main(int, char**) { return 0; }