Unverified Commit 507e17b0 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7247 from AquaGeek/quote-frameworks-in-other-ldflags

[XCConfigHelper] Quote framework names in OTHER_LDFLAGS
parents 3fe4b32a 91b1699f
...@@ -18,6 +18,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -18,6 +18,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Quote framework names in OTHER_LDFLAGS
[Tyler Stromberg](https://github.com/AquaGeek)
[#7185](https://github.com/CocoaPods/CocoaPods/issues/7185)
* Fix static framework archive regression from #7187 * Fix static framework archive regression from #7187
[Paul Beusterien](https://github.com/paulb777) [Paul Beusterien](https://github.com/paulb777)
[#7225](https://github.com/CocoaPods/CocoaPods/issues/7225) [#7225](https://github.com/CocoaPods/CocoaPods/issues/7225)
......
...@@ -219,7 +219,7 @@ module Pod ...@@ -219,7 +219,7 @@ module Pod
build_settings = { build_settings = {
'FRAMEWORK_SEARCH_PATHS' => quote([dirname]), 'FRAMEWORK_SEARCH_PATHS' => quote([dirname]),
} }
build_settings['OTHER_LDFLAGS'] = "-framework #{name}" if include_ld_flags build_settings['OTHER_LDFLAGS'] = "-framework \"#{name}\"" if include_ld_flags
xcconfig.merge!(build_settings) xcconfig.merge!(build_settings)
end end
...@@ -247,7 +247,7 @@ module Pod ...@@ -247,7 +247,7 @@ module Pod
build_settings = { build_settings = {
'LIBRARY_SEARCH_PATHS' => quote([dirname]), 'LIBRARY_SEARCH_PATHS' => quote([dirname]),
} }
build_settings['OTHER_LDFLAGS'] = "-l#{name}" if include_ld_flags build_settings['OTHER_LDFLAGS'] = "-l\"#{name}\"" if include_ld_flags
xcconfig.merge!(build_settings) xcconfig.merge!(build_settings)
end end
......
...@@ -119,7 +119,7 @@ module Pod ...@@ -119,7 +119,7 @@ module Pod
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"xml2"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"xml2"'
end end
it 'checks OTHER_LD_FLAGS and FRAMEWORK_SEARCH_PATHS for a vendored dependencies to a static framework' do it 'checks OTHER_LDFLAGS and FRAMEWORK_SEARCH_PATHS for a vendored dependencies to a static framework' do
spec = stub(:test_specification? => false) spec = stub(:test_specification? => false)
target_definition = stub(:inheritance => 'search_paths') target_definition = stub(:inheritance => 'search_paths')
consumer = stub( consumer = stub(
...@@ -159,7 +159,19 @@ module Pod ...@@ -159,7 +159,19 @@ module Pod
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '"${PODS_ROOT}/."' xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '"${PODS_ROOT}/."'
end end
it 'check that include_ld_flags being false doesnt generate OTHER_LD_FLAGS' do it 'quotes OTHER_LDFLAGS to properly handle spaces' do
framework_path = config.sandbox.root + 'Sample/Framework with Spaces.framework'
library_path = config.sandbox.root + 'Sample/libSample Lib.a'
xcconfig = Xcodeproj::Config.new
@sut.add_framework_build_settings(framework_path, xcconfig, config.sandbox.root)
@sut.add_library_build_settings(library_path, xcconfig, config.sandbox.root)
hash_config = xcconfig.to_hash
hash_config['OTHER_LDFLAGS'].should == '-l"Sample Lib" -framework "Framework with Spaces"'
end
it 'check that include_ld_flags being false doesnt generate OTHER_LDFLAGS' do
spec = stub(:test_specification? => false) spec = stub(:test_specification? => false)
target_definition = stub(:inheritance => 'search_paths') target_definition = stub(:inheritance => 'search_paths')
consumer = stub( consumer = stub(
......
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