Commit 08cd5990 authored by Boris Bügling's avatar Boris Bügling

[Target] Configure as extension only for app extensions

Set the APPLICATION_EXTENSION_API_ONLY build setting if integrating with
an app extension target
parent 3ff7d920
......@@ -467,6 +467,9 @@ module Pod
def set_target_dependencies
frameworks_group = pods_project.frameworks_group
aggregate_targets.each do |aggregate_target|
app_extension = aggregate_target.user_targets.map { |t| t.symbol_type }.include?(:app_extension)
set_app_extension_api_only_for_target(aggregate_target) if app_extension
aggregate_target.pod_targets.each do |pod_target|
unless pod_target.should_build?
pod_target.resource_bundle_targets.each do |resource_bundle_target|
......@@ -477,6 +480,8 @@ module Pod
end
aggregate_target.native_target.add_dependency(pod_target.native_target)
set_app_extension_api_only_for_target(pod_target) if app_extension
pod_target.dependencies.each do |dep|
unless dep == pod_target.pod_name
pod_dependency_target = aggregate_target.pod_targets.find { |target| target.pod_name == dep }
......@@ -487,6 +492,7 @@ module Pod
next unless pod_dependency_target.should_build?
pod_target.native_target.add_dependency(pod_dependency_target.native_target)
set_app_extension_api_only_for_target(pod_dependency_target) if app_extension
if pod_target.requires_frameworks?
product_ref = frameworks_group.files.find { |f| f.path == pod_dependency_target.product_name } ||
......@@ -694,6 +700,15 @@ module Pod
analysis_result.sandbox_state
end
# Sets the APPLICATION_EXTENSION_API_ONLY build setting to YES for all
# configurations of the given target
#
def set_app_extension_api_only_for_target(target)
target.native_target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
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