Simplify cxxstdlib_check implementation
The cxxstdlib_check method currently only supports one value, so we can just define the accompanying instance method when necessary. If we ever add more options we can back it with a data structure.
This commit is contained in:
parent
e6498f4dfc
commit
95aef55110
@ -16,10 +16,6 @@ class Formula
|
|||||||
"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev"
|
"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev"
|
||||||
end
|
end
|
||||||
|
|
||||||
def cxxstdlib
|
|
||||||
self.class.cxxstdlib
|
|
||||||
end
|
|
||||||
|
|
||||||
def cxxstdlib_check check_type
|
def cxxstdlib_check check_type
|
||||||
self.class.cxxstdlib_check check_type
|
self.class.cxxstdlib_check check_type
|
||||||
end
|
end
|
||||||
|
|||||||
@ -245,7 +245,7 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
def skip_cxxstdlib_check?
|
def skip_cxxstdlib_check?
|
||||||
self.class.cxxstdlib.include?(:skip)
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def require_universal_deps?
|
def require_universal_deps?
|
||||||
@ -712,16 +712,9 @@ class Formula
|
|||||||
@keg_only_reason = KegOnlyReason.new(reason, explanation)
|
@keg_only_reason = KegOnlyReason.new(reason, explanation)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Flag for marking whether this formula needs C++ standard library
|
# Pass :skip to this method to disable post-install stdlib checking
|
||||||
# compatibility check
|
|
||||||
def cxxstdlib
|
|
||||||
@cxxstdlib ||= Set.new
|
|
||||||
end
|
|
||||||
|
|
||||||
# Explicitly request changing C++ standard library compatibility check
|
|
||||||
# settings. Use with caution!
|
|
||||||
def cxxstdlib_check check_type
|
def cxxstdlib_check check_type
|
||||||
cxxstdlib << check_type
|
define_method(:skip_cxxstdlib_check?) { true } if check_type == :skip
|
||||||
end
|
end
|
||||||
|
|
||||||
# For Apple compilers, this should be in the format:
|
# For Apple compilers, this should be in the format:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user