aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 48068b9e1..cca54f229 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -340,6 +340,20 @@ module MacOS extend self
end
end
+ def clang_version
+ @clang_version ||= if File.exist? "/usr/bin/clang"
+ `/usr/bin/clang --version` =~ /clang version (\d\.\d)/
+ $1
+ end
+ end
+
+ def clang_build_version
+ @clang_build_version ||= if File.exist? "/usr/bin/clang"
+ `/usr/bin/clang --version` =~ %r[tags/Apple/clang-(\d{3}(\.\d)*)]
+ $1
+ end
+ end
+
def x11_installed?
Pathname.new('/usr/X11/lib/libpng.dylib').exist?
end