aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/development_tools.rb
diff options
context:
space:
mode:
authorAlex Wang2016-09-24 23:56:54 -0400
committerAlex Wang2016-11-18 08:54:09 -0500
commit3e4544025d664fe381be96bf2526f08b7464e3cb (patch)
tree23fb992f838c19177378727f246d1004a3e80cd2 /Library/Homebrew/development_tools.rb
parent5e073f1f404f2d2aaf16c30f224bdec91741fba8 (diff)
downloadbrew-3e4544025d664fe381be96bf2526f08b7464e3cb.tar.bz2
Prefer brewed Clang over gcc-6 for needs :openmp
Clang has fully implemented OpenMP support as of LLVM 3.7, so if OpenMP is required by a formula gcc is no longer the only choice of compiler. Clang should be preferred over gcc because using gcc meant linking against libstdc++, which is ABI incompatible with libc++. This may be unnoticeable for some users, but it causes other builds to fail, e.g. pstoedit when imagemagick was built with OpenMP. pstoedit is required for the octave formula, so for some users this could be a significant problem.
Diffstat (limited to 'Library/Homebrew/development_tools.rb')
-rw-r--r--Library/Homebrew/development_tools.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb
index 62f9b3d71..d081067a8 100644
--- a/Library/Homebrew/development_tools.rb
+++ b/Library/Homebrew/development_tools.rb
@@ -86,6 +86,13 @@ class DevelopmentTools
end
end
+ def llvm_clang_build_version
+ @llvm_clang_build_version ||= if Tab.for_name "llvm"
+ path = Formulary.factory("llvm").opt_prefix/"bin/clang"
+ `#{path} --version`[/clang version (\d\.\d\.\d)/, 1]
+ end
+ end
+
def non_apple_gcc_version(cc)
(@non_apple_gcc_version ||= {}).fetch(cc) do
path = HOMEBREW_PREFIX.join("opt", "gcc", "bin", cc)