Commit ec2b020a authored by Jonathan MacMillan's avatar Jonathan MacMillan

Ensure that the header search paths include the public headers in the sandbox,…

Ensure that the header search paths include the public headers in the sandbox, if there are any pods that are statically compiled into the user target, when integrating Pods as frameworks.
parent 9aae39e8
...@@ -17,6 +17,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -17,6 +17,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
least one of them fails linting. least one of them fails linting.
[#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