diff options
| author | Misty De Meo | 2013-10-06 16:59:39 -0700 |
|---|---|---|
| committer | Misty De Meo | 2013-10-06 19:26:06 -0700 |
| commit | 87b013719834ca5ae9241dd5fab5333e1f458aa6 (patch) | |
| tree | 08882eb74bf9e19d89e4c07f5a9b00b9e1433b3e /Library/Homebrew/cxxstdlib.rb | |
| parent | 74ab0234223332585f9d249c8d55a33de60a9b4c (diff) | |
| download | brew-87b013719834ca5ae9241dd5fab5333e1f458aa6.tar.bz2 | |
CxxStdlib: allow for nil stdlibs
A nil stdlib value represents non-C++ code.
Diffstat (limited to 'Library/Homebrew/cxxstdlib.rb')
| -rw-r--r-- | Library/Homebrew/cxxstdlib.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index 4e3bed22e..06668e991 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -2,11 +2,11 @@ class CxxStdlib attr_accessor :type, :compiler def initialize(type, compiler) - if ![:libstdcxx, :libcxx].include? type + if type && ![:libstdcxx, :libcxx].include?(type) raise ArgumentError, "Invalid C++ stdlib type: #{type}" end - @type = type.to_sym + @type = type.to_sym if type @compiler = compiler.to_sym end @@ -15,6 +15,9 @@ class CxxStdlib end def compatible_with?(other) + # If either package doesn't use C++, all is well + return true if type.nil? || other.type.nil? + # libstdc++ and libc++ aren't ever intercompatible return false unless type == other.type |
