diff options
| -rw-r--r-- | Library/Homebrew/cxxstdlib.rb | 19 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 12 |
2 files changed, 23 insertions, 8 deletions
diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index 2b4ec5827..fba868277 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -33,14 +33,17 @@ class CxxStdlib end def check_dependencies(formula, deps) - deps.each do |dep| - # Software is unlikely to link against anything from its buildtime deps, - # so it doesn't matter at all if they link against different C++ stdlibs - next if dep.tags.include? :build - - dep_stdlib = Tab.for_formula(dep.to_formula).cxxstdlib - if !compatible_with? dep_stdlib - raise IncompatibleCxxStdlibs.new(formula, dep, dep_stdlib, self) + unless formula.cxxstdlib.include? :skip + deps.each do |dep| + # Software is unlikely to link against anything from its + # buildtime deps, so it doesn't matter at all if they link + # against different C++ stdlibs + next if dep.tags.include? :build + + dep_stdlib = Tab.for_formula(dep.to_formula).cxxstdlib + if !compatible_with? dep_stdlib + raise IncompatibleCxxStdlibs.new(formula, dep, dep_stdlib, self) + end end end end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fd1884e4f..a760e7fc2 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -25,6 +25,10 @@ class Formula attr_accessor :local_bottle_path + # Flag for marking whether this formula needs C++ standard library + # compatibility check + attr_reader :cxxstdlib + # Homebrew determines the name def initialize name='__UNKNOWN__', path=nil @name = name @@ -52,6 +56,8 @@ class Formula @build = determine_build_options @pin = FormulaPin.new(self) + + @cxxstdlib ||= Set.new end def set_spec(name) @@ -643,6 +649,12 @@ class Formula end end + # Explicitly request changing C++ standard library compatibility check + # settings. Use with caution! + def cxxstdlib_check check_type + @cxxstdlib << check_type + end + def self.method_added method case method when :brew |
