Commit cf285e14 authored by Eloy Durán's avatar Eloy Durán

Merge pull request #2676 from CocoaPods/issue/2666

Fixes an issue when using pods in static library targets
parents e18e00c9 a8645c6f
...@@ -32,6 +32,14 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -32,6 +32,14 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Kurry Tran](https://github.com/kurry) [Kurry Tran](https://github.com/kurry)
[#2683](https://github.com/CocoaPods/CocoaPods/issues/2683) [#2683](https://github.com/CocoaPods/CocoaPods/issues/2683)
* Fixes an issue when using pods in static library targets and building with
Xcode 6 which requires `OTHER_LIBTOOLFLAGS` instead of `OTHER_LDFLAGS`, thus
basically reverting to the previous Xcode behaviour, for now at least.
[Kyle Fuller](https://github.com/kylef)
[Eloy Durán](https://github.com/alloy)
[#2666](https://github.com/CocoaPods/CocoaPods/issues/2666)
## 0.34.2 ## 0.34.2
##### Enhancements ##### Enhancements
...@@ -2619,7 +2627,7 @@ podspec, then update these method calls. ...@@ -2619,7 +2627,7 @@ podspec, then update these method calls.
generated Pods project file. generated Pods project file.
* [#142](https://github.com/CocoaPods/CocoaPods/issues/): Add `-fobjc-arc` to * [#142](https://github.com/CocoaPods/CocoaPods/issues/): Add `-fobjc-arc` to
`OTHER_LD_FLAGS` if _any_ pods require ARC. `OTHER_LDFLAGS` if _any_ pods require ARC.
* [#148](https://github.com/CocoaPods/CocoaPods/issues/148): External encoding * [#148](https://github.com/CocoaPods/CocoaPods/issues/148): External encoding
set to UTF-8 on Ruby 1.9 to fix crash caused by non-ascii characters in pod set to UTF-8 on Ruby 1.9 to fix crash caused by non-ascii characters in pod
......
...@@ -50,6 +50,7 @@ module Pod ...@@ -50,6 +50,7 @@ module Pod
header_search_path_flags = target.sandbox.public_headers.search_paths header_search_path_flags = target.sandbox.public_headers.search_paths
@xcconfig = Xcodeproj::Config.new( @xcconfig = Xcodeproj::Config.new(
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target), 'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
'OTHER_LIBTOOLFLAGS' => '$(OTHER_LDFLAGS)',
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(target.sandbox.public_headers.search_paths), 'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(target.sandbox.public_headers.search_paths),
'PODS_ROOT' => target.relative_pods_root, 'PODS_ROOT' => target.relative_pods_root,
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1', 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
......
...@@ -45,7 +45,7 @@ module Pod ...@@ -45,7 +45,7 @@ module Pod
configuration = @target.add_build_configuration(bc_name, type) configuration = @target.add_build_configuration(bc_name, type)
end end
settings = {} settings = { 'OTHER_LDFLAGS' => '', 'OTHER_LIBTOOLFLAGS' => '' }
if library.archs if library.archs
settings['ARCHS'] = library.archs settings['ARCHS'] = library.archs
end end
......
...@@ -85,6 +85,10 @@ module Pod ...@@ -85,6 +85,10 @@ module Pod
@xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include '-l"Pods-BananaLib"' @xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include '-l"Pods-BananaLib"'
end end
it 'should configure OTHER_LIBTOOLFLAGS flags to include OTHER_LDFLAGS' do
@xcconfig.to_hash['OTHER_LIBTOOLFLAGS'].should == '$(OTHER_LDFLAGS)'
end
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
before do before do
......
...@@ -29,7 +29,7 @@ module Pod ...@@ -29,7 +29,7 @@ module Pod
@installer = Installer::TargetInstaller.new(config.sandbox, @pod_target) @installer = Installer::TargetInstaller.new(config.sandbox, @pod_target)
end end
it 'Adds the architectures to the custom build configurations of the user target' do it 'adds the architectures to the custom build configurations of the user target' do
@pod_target.archs = '$(ARCHS_STANDARD_64_BIT)' @pod_target.archs = '$(ARCHS_STANDARD_64_BIT)'
@installer.send(:add_target) @installer.send(:add_target)
@installer.send(:target).resolved_build_setting('ARCHS').should == { @installer.send(:target).resolved_build_setting('ARCHS').should == {
...@@ -40,5 +40,11 @@ module Pod ...@@ -40,5 +40,11 @@ module Pod
} }
end end
it 'always clears the OTHER_LDFLAGS and OTHER_LIBTOOLFLAGS, because these lib targets do not ever need any' do
@installer.send(:add_target)
@installer.send(:target).resolved_build_setting('OTHER_LDFLAGS').values.uniq.should == ['']
@installer.send(:target).resolved_build_setting('OTHER_LIBTOOLFLAGS').values.uniq.should == ['']
end
end end
end end
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