lib/cocoapods/generator/xcconfig.rb
# Generates the xcconfig for the library.
#
# @return [Xcodeproj::Config]
#
# @note   The value `PODS_HEADERS_SEARCH_PATHS` is used to store the headers
#         so xcconfig can reference the variable.
#
Generates the xcconfig for the library.
Generates the xcconfig for the library .
def generate
        ld_flags = '-ObjC'
        if  set_arc_compatibility_flag && spec_consumers.any? { |consumer| consumer.requires_arc }
          ld_flags << ' -fobjc-arc'
        end
        @xcconfig = Xcodeproj::Config.new({
          'ALWAYS_SEARCH_USER_PATHS'         => 'YES',
          'OTHER_LDFLAGS'                    => ld_flags,
          'HEADER_SEARCH_PATHS'              => '${PODS_HEADERS_SEARCH_PATHS}',
          'PODS_ROOT'                        => relative_pods_root,
          'PODS_HEADERS_SEARCH_PATHS'        => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}',
          'PODS_BUILD_HEADERS_SEARCH_PATHS'  => quote(sandbox.build_headers.search_paths),
          'PODS_PUBLIC_HEADERS_SEARCH_PATHS' => quote(sandbox.public_headers.search_paths),
        })
        spec_consumers.each do |consumer|
          @xcconfig.merge!(consumer.xcconfig);
          @xcconfig.libraries.merge(consumer.libraries);
          @xcconfig.frameworks.merge(consumer.frameworks);
          @xcconfig.weak_frameworks.merge(consumer.weak_frameworks);
        end
        @xcconfig
      end
def generate ld_flags = '-ObjC' if set_arc_compatibility_flag && spec_consumers . any? { | consumer | consumer . requires_arc } ld_flags << ' -fobjc-arc' end @xcconfig = Xcodeproj :: Config . new ( { 'ALWAYS_SEARCH_USER_PATHS' => 'YES' , 'OTHER_LDFLAGS' => ld_flags , 'HEADER_SEARCH_PATHS' => '${PODS_HEADERS_SEARCH_PATHS}' , 'PODS_ROOT' => relative_pods_root , 'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}' , 'PODS_BUILD_HEADERS_SEARCH_PATHS' => quote ( sandbox . build_headers . search_paths ) , 'PODS_PUBLIC_HEADERS_SEARCH_PATHS' => quote ( sandbox . public_headers . search_paths ) , } ) spec_consumers . each do | consumer | @xcconfig . merge! ( consumer . xcconfig ) ; @xcconfig . libraries . merge ( consumer . libraries ) ; @xcconfig . frameworks . merge ( consumer . frameworks ) ; @xcconfig . weak_frameworks . merge ( consumer . weak_frameworks ) ; end @xcconfig end
Generates the xcconfig for the library.
Generates the xcconfig for the library .
None
Xcodeproj::Config
note
The value `PODS_HEADERS_SEARCH_PATHS` is used to store the headers so xcconfig can reference the variable.
The value ` PODS_HEADERS_SEARCH_PATHS ` is used to store the headers so xcconfig can reference the variable .