Commit 3e2dc6c8 authored by Marius Rackwitz's avatar Marius Rackwitz

[Refactor] Extract #custom_build_settings from TargetInstaller#add_target

This allows to extend the custom build settings in the concrete target-class specific subclasses.
parent 6c749769
...@@ -51,26 +51,32 @@ module Pod ...@@ -51,26 +51,32 @@ module Pod
configuration = @native_target.add_build_configuration(bc_name, type) configuration = @native_target.add_build_configuration(bc_name, type)
end end
@native_target.build_configurations.each do |configuration|
configuration.build_settings.merge!(custom_build_settings)
end
target.native_target = @native_target
end
# Returns the customized build settings which are overridden in the build
# settings of the user target.
#
# @return [Hash{String => String}]
#
def custom_build_settings
settings = {} settings = {}
if target.archs if target.archs
settings['ARCHS'] = target.archs settings['ARCHS'] = target.archs
end end
if target.is_a? AggregateTarget
settings['PODS_ROOT'] = '$(SRCROOT)'
end
if target.requires_frameworks? if target.requires_frameworks?
settings['PRODUCT_NAME'] = target.product_module_name settings['PRODUCT_NAME'] = target.product_module_name
else else
settings.merge!('OTHER_LDFLAGS' => '', 'OTHER_LIBTOOLFLAGS' => '') settings.merge!('OTHER_LDFLAGS' => '', 'OTHER_LIBTOOLFLAGS' => '')
end end
@native_target.build_configurations.each do |configuration| settings
configuration.build_settings.merge!(settings)
end
target.native_target = @native_target
end end
# Creates the directory where to store the support files of the target. # Creates the directory where to store the support files of the target.
......
...@@ -32,6 +32,13 @@ module Pod ...@@ -32,6 +32,13 @@ module Pod
private private
def custom_build_settings
settings = {
'PODS_ROOT' => '$(SRCROOT)',
}
super.merge(settings)
end
# Creates the group that holds the references to the support files # Creates the group that holds the references to the support files
# generated by this installer. # generated by this installer.
# #
......
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