From 48bdd4811ec5ef54e4e408b0dcc4b7659c648a7d Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Fri, 4 Dec 2015 14:40:24 -0800 Subject: [PATCH] MacOS.sdk: return newest SDK if requested not found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `MacOS.sdk` and `.sdk_path` will now return the newest installed SDK instead of nil if called on a system that doesn’t have an SDK for the currently-installed OS. For example, Xcode 7 on OS X 10.10 does not include the 10.10 SDK, only the 10.11 SDK; software can be built by specifying both SDKROOT and MACOSX_DEPLOYMENT_TARGET. --- Library/Homebrew/os/mac.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 893eb6ddfb..ec1471e462 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -89,6 +89,9 @@ module OS begin @locator.sdk_for v 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 end end