diff options
| author | ilovezfs | 2016-03-23 04:34:21 -0700 |
|---|---|---|
| committer | Xu Cheng | 2016-03-31 13:16:50 +0800 |
| commit | 45e138ffc6059570421dc203c2e69ba5214cdfaa (patch) | |
| tree | 9136d7018481dbc5308baf8ce03191cd0026dbcb | |
| parent | 9bbaaca98c2ba09fd2154e439466ab895270f04b (diff) | |
| download | brew-45e138ffc6059570421dc203c2e69ba5214cdfaa.tar.bz2 | |
Xcode 7 MACOSX_DEPLOYMENT_TARGET and SDK fixes
SDK 10.10 isn't something that exists for Xcode 7, so stop looking for
it and rely on MACOSX_DEPLOYMENT_TARGET instead.
See PR Homebrew/homebrew#50137 Yosemite build failure
Closes Homebrew/homebrew#50355.
Signed-off-by: ilovezfs <ilovezfs@icloud.com>
| -rw-r--r-- | Library/Homebrew/extend/ENV/super.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 15 |
2 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index e4eb86cdf..747a76956 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -67,7 +67,7 @@ module Superenv self["HOMEBREW_INCLUDE_PATHS"] = determine_include_paths self["HOMEBREW_LIBRARY_PATHS"] = determine_library_paths - if MacOS::Xcode.without_clt? + if MacOS::Xcode.without_clt? || (MacOS::Xcode.installed? && MacOS::Xcode.version.to_i >= 7) self["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s self["SDKROOT"] = MacOS.sdk_path end diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 900845859..a9227d790 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -90,19 +90,24 @@ module OS # If the requested SDK is not installed returns either: # a) The newest SDK (if any SDKs are available), or # b) nil - def sdk(v = version) + def sdk(v = nil) @locator ||= SDKLocator.new begin - @locator.sdk_for v + sdk = if v.nil? + Xcode.version.to_i >= 7 ? @locator.latest_sdk : @locator.sdk_for(version) + else + @locator.sdk_for v + end rescue SDKLocator::NoSDKError sdk = @locator.latest_sdk - # don't return an SDK that's older than the OS version - sdk unless sdk.nil? || sdk.version < version + ensure + # only return an SDK older than the OS version if it was specifically requested + sdk if v || (!sdk.nil? && sdk.version >= version) end end # Returns the path to an SDK or nil, following the rules set by #sdk. - def sdk_path(v = version) + def sdk_path(v = nil) s = sdk(v) s.path unless s.nil? end |
