Add '__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__' compatiblity quirks for MacOS >= 14 SDKs

This commit is contained in:
Thomas Pöchtrager 2023-08-17 22:44:57 +02:00
parent 96a651cfa7
commit 3279f86379
2 changed files with 10 additions and 0 deletions

View File

@ -886,6 +886,10 @@ bool Target::setup() {
#endif
if (isClang()) {
if (SDKOSNum >= OSVersion(14, 0) && clangversion < ClangVersion(17, 0)) {
// MacOS 14 SDK uses __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ in AvailabilityInternal.h
fargs.push_back("-D__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__=" + OSNum.numStr());
}
if (clangversion >= ClangVersion(3, 8)) {
//
// Silence:

View File

@ -332,6 +332,12 @@ struct OSVersion {
return tmp.str();
}
std::string numStr() const {
std::stringstream tmp;
tmp << Num();
return tmp.str();
}
int major;
int minor;
int patch;