Skip to content

Commit

Permalink
Merge pull request #9045 from drcapulet/alexc-link-vendor
Browse files Browse the repository at this point in the history
Include dependent vendored frameworks in linker flags
  • Loading branch information
dnkoutso committed Sep 13, 2019
2 parents dcc702d + fac1242 commit 1e86e46
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* Include dependent vendored frameworks in linker flags
[Alex Coomans](https://github.com/drcapulet)
[#9045]((https://github.com/CocoaPods/CocoaPods/pull/9045)

* Correctly set deployment target for non library specs even if the root spec does not specify one.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#9153](https://github.com/CocoaPods/CocoaPods/pull/9153)
Expand Down
12 changes: 8 additions & 4 deletions lib/cocoapods/target/build_settings.rb
Expand Up @@ -564,12 +564,16 @@ def initialize(target, non_library_spec = nil)

frameworks = []
frameworks.concat consumer_frameworks
if library_xcconfig? && (target.should_build? && target.build_as_dynamic?)
frameworks.concat vendored_static_frameworks.map { |l| File.basename(l, '.framework') }
end
if non_library_xcconfig?
if library_xcconfig?
# We know that this library target is being built dynamically based
# on the guard above, so include any vendored static frameworks.
frameworks.concat vendored_static_frameworks.map { |l| File.basename(l, '.framework') } if target.should_build?
# Also include any vendored dynamic frameworks of dependencies.
frameworks.concat dependent_targets.reject(&:should_build?).flat_map { |pt| pt.build_settings.dynamic_frameworks_to_import }
else
frameworks.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings.frameworks_to_import }
end

frameworks
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/target/build_settings/pod_target_settings_spec.rb
Expand Up @@ -89,8 +89,8 @@ class BuildSettings
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-weak_framework "iAd"')
end

it 'does not include the vendored dynamic frameworks for dependency pods of the specification' do
@xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include('-framework "dynamic-monkey"')
it 'does include the vendored dynamic frameworks for dependency pods of the specification' do
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-framework "dynamic-monkey"')
end

it 'does not include vendored static frameworks for dependency pods of the specification' do
Expand Down

0 comments on commit 1e86e46

Please sign in to comment.