aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cxxstdlib.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cxxstdlib.rb')
-rw-r--r--Library/Homebrew/cxxstdlib.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb
index 859c1aabb..7c3beafc8 100644
--- a/Library/Homebrew/cxxstdlib.rb
+++ b/Library/Homebrew/cxxstdlib.rb
@@ -3,6 +3,15 @@ require "compilers"
class CxxStdlib
include CompilerConstants
+ class CompatibilityError < StandardError
+ def initialize(formula, dep, stdlib)
+ super <<-EOS.undent
+ #{formula.name} dependency #{dep.name} was built with a different C++ standard
+ library (#{stdlib.type_string} from #{stdlib.compiler}). This may cause problems at runtime.
+ EOS
+ end
+ end
+
def self.create(type, compiler)
if type && ![:libstdcxx, :libcxx].include?(type)
raise ArgumentError, "Invalid C++ stdlib type: #{type}"
@@ -18,7 +27,7 @@ class CxxStdlib
begin
stdlib.check_dependencies(formula, deps)
- rescue IncompatibleCxxStdlibs => e
+ rescue CompatibilityError => e
opoo e.message
end
end
@@ -51,7 +60,7 @@ class CxxStdlib
dep_stdlib = Tab.for_formula(dep.to_formula).cxxstdlib
if !compatible_with? dep_stdlib
- raise IncompatibleCxxStdlibs.new(formula, dep, dep_stdlib, self)
+ raise CompatibilityError.new(formula, dep, dep_stdlib)
end
end
end