Commit 0cc8c2de authored by Marius Rackwitz's avatar Marius Rackwitz

[Podfile] Internalize checks whether warnings should be inhibited

parent 1db8d02a
......@@ -234,7 +234,7 @@ module Pod
flags << '-DOS_OBJECT_USE_OBJC=0'
end
end
if target_definition.inhibits_warnings_for_pod?(consumer.spec.root.name)
if target.inhibit_warnings?
flags << '-w -Xanalyzer -analyzer-disable-all-checks'
end
flags * ' '
......
......@@ -152,6 +152,29 @@ module Pod
end
end
# Checks if warnings should be inhibited for this pod.
#
# @return [Bool]
#
def inhibit_warnings?
whitelists = target_definitions.map do |target_definition|
target_definition.inhibits_warnings_for_pod?(root_spec.name)
end.uniq
if whitelists.empty?
return false
elsif whitelists.count == 1
whitelists.first
else
UI.warn "The pod `#{pod_name}` is linked to different targets " \
"(#{target_definitions.map(&:label)}), which contain different " \
'settings to inhibit warnings. CocoaPods does not currently ' \
'support different settings and will fall back to your preference ' \
'set in the root target definition.'
return podfile.root_target_definitions.first.inhibits_warnings_for_pod?(root_spec.name)
end
end
private
# @param [TargetDefinition] target_definition
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment