Commit 37ca3381 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3859 from perotinus/headers_for_static_pods_with_use_frameworks

Add header search paths for static library pods to the user target when integrating Pods as frameworks
parents 22928bf0 b70fa678
...@@ -18,6 +18,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -18,6 +18,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[#3869](https://github.com/CocoaPods/CocoaPods/issues/3869) [#3869](https://github.com/CocoaPods/CocoaPods/issues/3869)
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
* Set header search paths properly on the user target when `vendored_libraries`
Pods are used while integrating Pods as frameworks.
[#3857](https://github.com/CocoaPods/CocoaPods/issues/3857)
[Jonathan MacMillan](https://github.com/perotinus)
## 0.38.0 ## 0.38.0
......
...@@ -93,8 +93,7 @@ module Pod ...@@ -93,8 +93,7 @@ module Pod
# #
def generate_settings_to_import_pod_targets def generate_settings_to_import_pod_targets
if target.requires_frameworks? if target.requires_frameworks?
# Framework headers are automatically discoverable by `#import <…>`. framework_header_search_paths = pod_targets.select(&:should_build?).map do |target|
header_search_paths = pod_targets.map do |target|
if target.scoped? if target.scoped?
"$PODS_FRAMEWORK_BUILD_PATH/#{target.product_name}/Headers" "$PODS_FRAMEWORK_BUILD_PATH/#{target.product_name}/Headers"
else else
...@@ -103,9 +102,15 @@ module Pod ...@@ -103,9 +102,15 @@ module Pod
end end
build_settings = { build_settings = {
'PODS_FRAMEWORK_BUILD_PATH' => target.scoped_configuration_build_dir, 'PODS_FRAMEWORK_BUILD_PATH' => target.scoped_configuration_build_dir,
# Make headers discoverable by `import "…"` # Make framework headers discoverable by `import "…"`
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_paths, '-iquote'), 'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(framework_header_search_paths, '-iquote'),
} }
if pod_targets.any? { |t| !t.should_build? }
# Make library headers discoverale by `#import "…"`
library_header_search_paths = target.sandbox.public_headers.search_paths(target.platform)
build_settings['HEADER_SEARCH_PATHS'] = XCConfigHelper.quote(library_header_search_paths)
build_settings['OTHER_CFLAGS'] += XCConfigHelper.quote(library_header_search_paths, '-isystem')
end
if pod_targets.any? { |t| t.should_build? && t.scoped? } if pod_targets.any? { |t| t.should_build? && t.scoped? }
build_settings['FRAMEWORK_SEARCH_PATHS'] = '$(inherited) "$PODS_FRAMEWORK_BUILD_PATH"' build_settings['FRAMEWORK_SEARCH_PATHS'] = '$(inherited) "$PODS_FRAMEWORK_BUILD_PATH"'
end end
......
...@@ -157,6 +157,21 @@ module Pod ...@@ -157,6 +157,21 @@ module Pod
it 'configures the project to load all members that implement Objective-c classes or categories' do it 'configures the project to load all members that implement Objective-c classes or categories' do
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include '-ObjC' @xcconfig.to_hash['OTHER_LDFLAGS'].should.include '-ObjC'
end end
it 'does not include framework header paths as local headers for pods that are linked statically' do
monkey_headers = '-iquote "$CONFIGURATION_BUILD_DIR/monkey.framework/Headers"'
@xcconfig.to_hash['OTHER_CFLAGS'].should.not.include monkey_headers
end
it 'includes the public header paths as system headers' do
expected = '-isystem "${PODS_ROOT}/Headers/Public"'
@xcconfig.to_hash['OTHER_CFLAGS'].should.include expected
end
it 'includes the public header paths as user headers' do
expected = '${PODS_ROOT}/Headers/Public'
@xcconfig.to_hash['HEADER_SEARCH_PATHS'].should.include expected
end
end end
it 'sets the PODS_FRAMEWORK_BUILD_PATH build variable' do it 'sets the PODS_FRAMEWORK_BUILD_PATH build variable' do
......
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