From 0cd048a7a848b6aca78ab6176d3e144356512282 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:59:32 +0100 Subject: [PATCH] Improve procedure to construct best link command for macOS platform As discussed between Matthias, Albrecht and Manolo, the best procedure is - use MAC_OS_X_VERSION_MAX_ALLOWED but not __MAC_OS_X_VERSION_MAX_ALLOWED; - compile helper file CMake /macOSMaxAllowed.c to detect whether the SDK in use is in version above a given threshold version number; - based upon the result of this check, decide to weakly link or not a given framework. --- CMake/macOSMaxAllowed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMake/macOSMaxAllowed.c b/CMake/macOSMaxAllowed.c index 665d243895..4628348d31 100644 --- a/CMake/macOSMaxAllowed.c +++ b/CMake/macOSMaxAllowed.c @@ -1,6 +1,6 @@ #include -#if __MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK -#error __MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK +#if MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK +#error MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK #endif int main(int argc, char** argv) { return 0; }