sdk: use unversioned SDK path on Big Sur

Fixes https://github.com/Homebrew/homebrew-core/issues/67075.

This implements @fxcoudert's suggestion in the issue linked above.
This commit is contained in:
carlocab 2020-12-20 14:02:48 +00:00
parent 993bf95877
commit 3f0ed01a2a
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -91,6 +91,14 @@ module OS
paths[OS::Mac::Version.new(version)] = sdk_path if version.present?
end
# Use unversioned SDK path on Big Sur to avoid issues such as:
# https://github.com/Homebrew/homebrew-core/issues/67075
if OS::Mac.version >= :big_sur
sdk_path = File.join(sdk_prefix, "MacOSX.sdk")
version = OS::Mac.full_version
paths[version] = sdk_path if File.directory?(sdk_path)
end
paths
else
{}