development_tools: return llvm_clang Version class.

This was implemented before the rest of the file was refactored.
This commit is contained in:
Mike McQuaid 2016-11-21 08:49:29 +00:00
parent a3f03e2066
commit 28a00e9d6c

View File

@ -85,12 +85,18 @@ class DevelopmentTools
else
Version::NULL
end
end
end
def llvm_clang_build_version
@llvm_clang_build_version ||= if Tab.for_name "llvm"
@llvm_clang_build_version ||= begin
path = Formulary.factory("llvm").opt_prefix/"bin/clang"
`#{path} --version`[/clang version (\d\.\d\.\d)/, 1]
if path.executable? &&
build_version = `#{path} --version`[/clang version (\d\.\d\.\d)/, 1]
Version.new build_version
else
Version::NULL
end
end
end