Unverified Commit a60448c4 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by Samuel Giddins

Merge pull request #7601 from paulb777/imp-in-both

Fix static framework dependent target double linking 

(cherry picked from commit 8e0f3b09)
parent 81b66c55
......@@ -17,6 +17,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Paul Beusterien](https://github.com/paulb777)
[#7597](https://github.com/CocoaPods/CocoaPods/issues/7597)
* Fix static framework dependent target double linking without use_frameworks
[Paul Beusterien](https://github.com/paulb777)
[#7592](https://github.com/CocoaPods/CocoaPods/issues/7592)
* Inhibit warnings for all dependencies during validation except for the one being validated
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7434](https://github.com/CocoaPods/CocoaPods/issues/7434)
......
......@@ -489,7 +489,7 @@ module Pod
unless aggregate_target.nil?
dependent_targets = aggregate_target.search_paths_aggregate_targets
dependent_targets.each do |dependent_target|
if dependent_target.pod_targets.any?(&:static_framework?)
if aggregate_target.requires_frameworks? && dependent_target.pod_targets.any?(&:static_framework?)
generate_other_ld_flags(dependent_target, dependent_target.pod_targets, xcconfig)
end
end
......
......@@ -250,12 +250,56 @@ module Pod
:target_definition => target_definition,
:pod_targets => [],
:search_paths_aggregate_targets => [aggregate_target],
:requires_frameworks? => true,
)
xcconfig = Xcodeproj::Config.new
@sut.generate_other_ld_flags(test_aggregate_target, [], xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "Foo"'
end
it 'makes sure setting from search_paths dont propagate for static frameworks when static linking' do
target_definition = stub('target_definition', :inheritance => 'search_paths')
consumer = stub('consumer',
:pod_target_xcconfig => {},
:libraries => ['xml2'],
:frameworks => ['Foo'],
:weak_frameworks => [],
:platform_name => :ios,
)
file_accessor = stub('file_accessor',
:spec_consumer => consumer,
:vendored_static_frameworks => [],
:vendored_dynamic_frameworks => [],
:vendored_static_libraries => [],
:vendored_dynamic_libraries => [],
)
pod_target = stub('pod_target',
:name => 'BananaLib',
:sandbox => config.sandbox,
:should_build? => true,
:requires_frameworks? => false,
:static_framework? => true,
:dependent_targets => [],
:file_accessors => [file_accessor],
:product_basename => 'Foo',
)
pod_targets = [pod_target]
aggregate_target = stub('aggregate_target',
:target_definition => target_definition,
:pod_targets => pod_targets,
:search_paths_aggregate_targets => [],
)
test_aggregate_target = stub('test_aggregate_target',
:target_definition => target_definition,
:pod_targets => [],
:search_paths_aggregate_targets => [aggregate_target],
:requires_frameworks? => false,
)
xcconfig = Xcodeproj::Config.new
@sut.generate_other_ld_flags(test_aggregate_target, [], xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should.be.nil
end
it 'includes HEADER_SEARCH_PATHS from search paths' do
xcconfig = Xcodeproj::Config.new
spec_consumer = stub('spec_consumer', :user_target_xcconfig => { 'HEADER_SEARCH_PATHS' => 'my/path' })
......
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