Un-break MacOS.sdk_path
MacOS.sdk_path is meant to return the SDK path that matches the version argument, so store the result in a hash. Fixes Homebrew/homebrew#13623. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
		
							parent
							
								
									8d949520ec
								
							
						
					
					
						commit
						4dde88b6d3
					
				@ -92,10 +92,11 @@ module MacOS extend self
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def sdk_path v=version
 | 
			
		||||
    @sdk_path ||= begin
 | 
			
		||||
    @sdk_path ||= {}
 | 
			
		||||
    @sdk_path[v.to_s] ||= begin
 | 
			
		||||
      path = if not Xcode.bad_xcode_select_path? and File.executable? "#{Xcode.folder}/usr/bin/make"
 | 
			
		||||
        `#{locate('xcodebuild')} -version -sdk macosx#{v} Path 2>/dev/null`.strip
 | 
			
		||||
      elsif File.directory? '/Developer/SDKs/MacOS#{v}.sdk'
 | 
			
		||||
      elsif File.directory? "/Developer/SDKs/MacOS#{v}.sdk"
 | 
			
		||||
        # the old default (or wild wild west style)
 | 
			
		||||
        "/Developer/SDKs/MacOS#{v}.sdk"
 | 
			
		||||
      elsif File.directory? "#{Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{v}.sdk"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user