aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-08-09 17:47:10 -0500
committerJack Nagel2014-08-09 17:50:52 -0500
commit105db77fc08df7a8dc85dcef626ec82998207117 (patch)
treef82288d94f198590e2388029c466652711f3a45e /Library
parentf743351c6082f2b86fa47713b870ab8d685a7226 (diff)
downloadbrew-105db77fc08df7a8dc85dcef626ec82998207117.tar.bz2
Extract build-time stdlib check to a method
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/build.rb48
1 files changed, 25 insertions, 23 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index ef7c2c45d..ff35b797a 100644
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -163,29 +163,7 @@ class Build
begin
f.install
-
- keg = Keg.new(f.prefix)
- # This first test includes executables because we still
- # want to record the stdlib for something that installs no
- # dylibs.
- stdlibs = keg.detect_cxx_stdlibs
- # This currently only tracks a single C++ stdlib per dep,
- # though it's possible for different libs/executables in
- # a given formula to link to different ones.
- stdlib_in_use = CxxStdlib.create(stdlibs.first, ENV.compiler)
- begin
- stdlib_in_use.check_dependencies(f, deps)
- rescue IncompatibleCxxStdlibs => e
- opoo e.message
- end
-
- # This second check is recorded for checking dependencies,
- # so executable are irrelevant at this point. If a piece
- # of software installs an executable that links against libstdc++
- # and dylibs against libc++, libc++-only dependencies can safely
- # link against it.
- stdlibs = keg.detect_cxx_stdlibs :skip_executables => true
-
+ stdlibs = detect_stdlibs
Tab.create(f, ENV.compiler, stdlibs.first, f.build).write
rescue Exception => e
if ARGV.debug?
@@ -201,6 +179,30 @@ class Build
end
end
+ def detect_stdlibs
+ keg = Keg.new(f.prefix)
+ # This first test includes executables because we still
+ # want to record the stdlib for something that installs no
+ # dylibs.
+ stdlibs = keg.detect_cxx_stdlibs
+ # This currently only tracks a single C++ stdlib per dep,
+ # though it's possible for different libs/executables in
+ # a given formula to link to different ones.
+ stdlib_in_use = CxxStdlib.create(stdlibs.first, ENV.compiler)
+ begin
+ stdlib_in_use.check_dependencies(f, deps)
+ rescue IncompatibleCxxStdlibs => e
+ opoo e.message
+ end
+
+ # This second check is recorded for checking dependencies,
+ # so executable are irrelevant at this point. If a piece
+ # of software installs an executable that links against libstdc++
+ # and dylibs against libc++, libc++-only dependencies can safely
+ # link against it.
+ stdlibs = keg.detect_cxx_stdlibs :skip_executables => true
+ end
+
def fixopt f
path = if f.linked_keg.directory? and f.linked_keg.symlink?
f.linked_keg.resolved_path