Fix the way to check OS version#662
Conversation
f6c6abe to
97e6403
Compare
| [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version]; | ||
| } | ||
| #endif | ||
| check_system_version(); |
There was a problem hiding this comment.
if ([NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]) {
NSOperatingSystemVersion version = {10, 13, 0};
is_macos_high_sierra_or_later = [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version];
}
There was a problem hiding this comment.
Sorry, I meant we don't need check_system_version method, specially the SystemVersion.plist part since isOperatingSystemAtLeastVersion: is available on 10.10 or later.
There was a problem hiding this comment.
When build MacVim with env MACOSX_DEPLOYMENT_TARGET < 10.10 (.travis.yml has set =10.8) isOperatingSystemAtLeastVersion: isn't available, so cannot build.
Therefore SystemVersion.plist part is needed in order to use MacVim built with env MACOSX_DEPLOYMENT_TARGET < 10.10 on 10.13.
There was a problem hiding this comment.
I don't think we need to support that situation. Using SDK 10.9 or earlier and run the binary on 10.13 or later. It's overkill. We do support the latest Xcode + the latest SDK, and the binary could run on 10.8. Probably people can use SDK 10.8 for building MacVim for 10.8, but not for 10.13.
There was a problem hiding this comment.
So the minimal code would look like
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
if ([[NSProcessInfo processInfo]
respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)])
{
NSOperatingSystemVersion version = {10, 13, 0};
is_macos_high_sierra_or_later =
[[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version];
}
#endif
return OK;
There was a problem hiding this comment.
On travis build (MACOSX_DEPLOYMENT_TARGET=10.8), MAC_OS_X_VERSION_MAX_ALLOWED is MAC_OS_X_VERSION_10_8 so that code block is dropped.
There was a problem hiding this comment.
Current master .travis.yml uses xcode9.2, so MAC_OS_X_VERSION_MAX_ALLOWED would be 10.12 or 10.13, and MAC_OS_X_VERSION_MIN_REQUIRED is 10.8 as MACOSX_DEPLOYMENT_TARGET in .travis.yml.
There was a problem hiding this comment.
Oh, MAC_OS_X_VERSION_MAX_ALLOWED... I saw wrong. OK, I understand.
97e6403 to
6a63a82
Compare
6a63a82 to
dd4c394
Compare
Improved #659
When
MACOSX_DEPLOYMENT_TARGETis prior than 10.10, we can check OS version by readingProductVersionfrom /System/Library/CoreServices/SystemVersion.plist.