Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add Xcode version to brew --config

  • Loading branch information...
commit c946f1f1ab25aaf20d865d7cd0d08074e3e9ae60 1 parent d9137b1
@adamv adamv authored
Showing with 7 additions and 0 deletions.
  1. +5 −0 Library/Homebrew/brew.h.rb
  2. +2 −0  bin/brew
View
5 Library/Homebrew/brew.h.rb
@@ -579,6 +579,11 @@ def llvm_build
end
end
+def xcode_version
+ `xcodebuild -version 2>&1` =~ /Xcode (\d(\.\d)*)/
+ return $1 ? $1 : nil
+end
+
def _compiler_recommendation build, recommended
message = (!build.nil? && build < recommended) ? "(#{recommended} or newer recommended)" : ""
return build, message
View
2  bin/brew
@@ -49,6 +49,7 @@ def dump_config
llvm, llvm_msg = _compiler_recommendation llvm_build, RECOMMENDED_LLVM
gcc_42, gcc_42_msg = _compiler_recommendation gcc_42_build, RECOMMENDED_GCC_42
gcc_40, gcc_40_msg = _compiler_recommendation gcc_40_build, RECOMMENDED_GCC_40
+ xcode = xcode_version || "?"
puts <<-EOS
HOMEBREW_VERSION: #{HOMEBREW_VERSION}
@@ -62,6 +63,7 @@ OS X: #{MACOS_FULL_VERSION}
Kernel Architecture: #{kernel_arch}
Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}
/usr/bin/ruby => #{system_ruby.realpath}
+Xcode: #{xcode}
GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"} #{gcc_42_msg}
GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"} #{gcc_40_msg}
LLVM: #{llvm ? "build #{llvm}" : "N/A" } #{llvm_msg}
Please sign in to comment.
Something went wrong with that request. Please try again.