mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
os/mac/sdk: prioritise SDK matching OS version
This commit is contained in:
parent
19050bd738
commit
20d9f436ca
@ -81,17 +81,8 @@ module OS
|
|||||||
# are available) is returned.
|
# are available) is returned.
|
||||||
# 3. If no SDKs are available, nil is returned.
|
# 3. If no SDKs are available, nil is returned.
|
||||||
#
|
#
|
||||||
# If no specific SDK is requested:
|
# If no specific SDK is requested, the SDK matching the OS version is returned,
|
||||||
#
|
# if available. Otherwise, the latest SDK is returned.
|
||||||
# 1. For Xcode >= 7, the latest SDK is returned even if the latest SDK is
|
|
||||||
# named after a newer OS version than the running OS. The
|
|
||||||
# `MACOSX_DEPLOYMENT_TARGET` must be set to the OS for which you're
|
|
||||||
# actually building (usually the running OS version).
|
|
||||||
# - https://github.com/Homebrew/legacy-homebrew/pull/50355
|
|
||||||
# - https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/Introduction.html#//apple_ref/doc/uid/TP40004626
|
|
||||||
# Section "About SDKs and Simulator"
|
|
||||||
# 2. For Xcode < 7, proceed as if the SDK for the running OS version had
|
|
||||||
# specifically been requested according to the rules above.
|
|
||||||
|
|
||||||
def sdk(v = nil)
|
def sdk(v = nil)
|
||||||
@locator ||= if Xcode.installed?
|
@locator ||= if Xcode.installed?
|
||||||
|
@ -33,7 +33,7 @@ module OS
|
|||||||
def sdk_if_applicable(v = nil)
|
def sdk_if_applicable(v = nil)
|
||||||
sdk = begin
|
sdk = begin
|
||||||
if v.nil?
|
if v.nil?
|
||||||
(source_version.to_i >= 7) ? latest_sdk : sdk_for(OS::Mac.version)
|
sdk_for OS::Mac.version
|
||||||
else
|
else
|
||||||
sdk_for v
|
sdk_for v
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user