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.
This commit is contained in:
ManoloFLTK 2024-11-28 14:59:32 +01:00
parent be6966bda6
commit 0cd048a7a8

View File

@ -1,6 +1,6 @@
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
#if __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 #error MAC_OS_X_VERSION_MAX_ALLOWED < SDK_VERSION_CHECK
#endif #endif
int main(int argc, char** argv) { return 0; } int main(int argc, char** argv) { return 0; }