os/mac/sdk: use unversioned SDK if matching version isn't found
This commit is contained in:
parent
c20b3ab913
commit
fb358071ce
@ -59,6 +59,8 @@ module OS
|
||||
# Bail out if there is no SDK prefix at all
|
||||
return @all_sdks unless File.directory? sdk_prefix
|
||||
|
||||
found_versions = Set.new
|
||||
|
||||
Dir["#{sdk_prefix}/MacOSX*.sdk"].each do |sdk_path|
|
||||
next unless sdk_path.match?(SDK::VERSIONED_SDK_REGEX)
|
||||
|
||||
@ -66,15 +68,14 @@ module OS
|
||||
next if version.nil?
|
||||
|
||||
@all_sdks << SDK.new(version, sdk_path, source)
|
||||
found_versions << version
|
||||
end
|
||||
|
||||
# Fall back onto unversioned SDK if we've not found a suitable SDK
|
||||
if @all_sdks.empty?
|
||||
# Use unversioned SDK only if we don't have one matching that version.
|
||||
sdk_path = Pathname.new("#{sdk_prefix}/MacOSX.sdk")
|
||||
if (version = read_sdk_version(sdk_path))
|
||||
if (version = read_sdk_version(sdk_path)) && found_versions.exclude?(version)
|
||||
@all_sdks << SDK.new(version, sdk_path, source)
|
||||
end
|
||||
end
|
||||
|
||||
@all_sdks
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user