Skip to content

Commit

Permalink
Fix generating without but consuming a vendored dynamic artifact.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkoutso committed Mar 28, 2017
1 parent 6a6df6f commit a751db9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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

* Fix generating `LD_RUNPATH_SEARCH_PATHS` without `use_frameworks!` but consuming a vendored dynamic artifact.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6596](https://github.com/CocoaPods/CocoaPods/issues/6596)

* Fix building with static lib subprojects (previously only supported framework subprojects).
[Ben Asher](https://github.com/benasher44)
[#5830](https://github.com/CocoaPods/CocoaPods/issues/5830)
Expand Down
6 changes: 5 additions & 1 deletion lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
Expand Up @@ -80,7 +80,11 @@ def generate
# See https://github.com/CocoaPods/CocoaPods/issues/1216
@xcconfig.attributes.delete('USE_HEADERMAP')

generate_ld_runpath_search_paths if target.requires_frameworks?
# If any of the aggregate target dependencies bring in any vendored dynamic artifacts we should ensure to
# update the runpath search paths.
vendored_dynamic_artifacts = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_dynamic_artifacts)

generate_ld_runpath_search_paths if target.requires_frameworks? || vendored_dynamic_artifacts.count > 0

@xcconfig
end
Expand Down
7 changes: 7 additions & 0 deletions spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
Expand Up @@ -218,6 +218,11 @@ def specs
expected = '$(inherited)'
@xcconfig.to_hash['HEADER_SEARCH_PATHS'].should.include expected
end

it 'includes default runpath search path list when not using frameworks but links a vendored dynamic framework' do
@target.stubs(:requires_frameworks?).returns(false)
@generator.generate.to_hash['LD_RUNPATH_SEARCH_PATHS'].should == "$(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'"
end
end

describe 'with a scoped pod target' do
Expand Down Expand Up @@ -266,11 +271,13 @@ def pod_target(spec, target_definition)
end

it 'includes default runpath search path list for a non host target' do
@target.stubs(:requires_frameworks?).returns(true)
@target.stubs(:requires_host_target?).returns(false)
@generator.generate.to_hash['LD_RUNPATH_SEARCH_PATHS'].should == "$(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'"
end

it 'includes default runpath search path list for a host target' do
@target.stubs(:requires_frameworks?).returns(true)
@target.stubs(:requires_host_target?).returns(true)
@generator.generate.to_hash['LD_RUNPATH_SEARCH_PATHS'].should == "$(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'"
end
Expand Down

0 comments on commit a751db9

Please sign in to comment.