lib/cocoapods/installer/target_installer.rb
def add_target
        name = library.label
        platform = library.platform.name
        deployment_target = library.platform.deployment_target.to_s
        @target = project.new_target(:static_library, name, platform, deployment_target)

        settings = {}
        if library.platform.requires_legacy_ios_archs?
          settings['ARCHS'] = "armv6 armv7"
        end
        if target_definition.inhibit_all_warnings?
          settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
        end

        @target.build_settings('Debug').merge!(settings)
        @target.build_settings('Release').merge!(settings)

        library.user_build_configurations.each do |lib_name, type|
          unless @target.build_configurations.map(&:name).include?(lib_name)
            build_config = project.new(Xcodeproj::Project::XCBuildConfiguration)
            build_config.name = lib_name
            settings = @target.build_settings(type.to_s.capitalize)
            build_config.build_settings = settings
            target.build_configurations << build_config
            project.build_configurations << build_config
          end
        end

        library.target = @target
      end
# Adds the target for the library to the Pods project with the
# appropriate build configurations.
#
# @note   The `PODS_HEADERS_SEARCH_PATHS` overrides the xcconfig.
#
# @todo   Add integration test for build configurations and don't add the
#         build configurations to the project if they are not needed.
#
# @return [void]
#
Adds the target for the library to the Pods project with the
appropriate build configurations.
Adds the target for the library to the Pods project with the appropriate build configurations .
def add_target
        name = library.label
        platform = library.platform.name
        deployment_target = library.platform.deployment_target.to_s
        @target = project.new_target(:static_library, name, platform, deployment_target)
        settings = {}
        if library.platform.requires_legacy_ios_archs?
          settings['ARCHS'] = "armv6 armv7"
        end
        if target_definition.inhibit_all_warnings?
          settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
        end
        @target.build_settings('Debug').merge!(settings)
        @target.build_settings('Release').merge!(settings)
        library.user_build_configurations.each do |lib_name, type|
          unless @target.build_configurations.map(&:name).include?(lib_name)
            build_config = project.new(Xcodeproj::Project::XCBuildConfiguration)
            build_config.name = lib_name
            settings = @target.build_settings(type.to_s.capitalize)
            build_config.build_settings = settings
            target.build_configurations << build_config
            project.build_configurations << build_config
          end
        end
        library.target = @target
      end
def add_target name = library . label platform = library . platform . name deployment_target = library . platform . deployment_target . to_s @target = project . new_target ( :static_library , name , platform , deployment_target ) settings = { } if library . platform . requires_legacy_ios_archs? settings [ 'ARCHS' ] = "armv6 armv7" end if target_definition . inhibit_all_warnings? settings [ 'GCC_WARN_INHIBIT_ALL_WARNINGS' ] = 'YES' end @target . build_settings ( 'Debug' ) . merge! ( settings ) @target . build_settings ( 'Release' ) . merge! ( settings ) library . user_build_configurations . each do | lib_name , type | unless @target . build_configurations . map ( & :name ) . include? ( lib_name ) build_config = project . new ( Xcodeproj :: Project :: XCBuildConfiguration ) build_config . name = lib_name settings = @target . build_settings ( type . to_s . capitalize ) build_config . build_settings = settings target . build_configurations << build_config project . build_configurations << build_config end end library . target = @target end
Adds the target for the library to the Pods project with the
appropriate build configurations.
Adds the target for the library to the Pods project with the appropriate build configurations .
None
void
note
The `PODS_HEADERS_SEARCH_PATHS` overrides the xcconfig.
The ` PODS_HEADERS_SEARCH_PATHS ` overrides the xcconfig .
todo
Add integration test for build configurations and don't add the build configurations to the project if they are not needed.
Add integration test for build configurations and don ' t add the build configurations to the project if they are not needed .