Commit a0a9a853 authored by Marius Rackwitz's avatar Marius Rackwitz

Add Swift specific settings to the generated xcconfig files if required

parent 816970fc
...@@ -57,6 +57,8 @@ module Pod ...@@ -57,6 +57,8 @@ module Pod
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_path_flags, '-isystem') 'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_path_flags, '-isystem')
) )
XCConfigHelper.add_language_specific_settings(target, @xcconfig)
target.pod_targets.each do |pod_target| target.pod_targets.each do |pod_target|
next unless pod_target.include_in_build_config?(@configuration_name) next unless pod_target.include_in_build_config?(@configuration_name)
......
...@@ -59,6 +59,7 @@ module Pod ...@@ -59,6 +59,7 @@ module Pod
xcconfig_hash = add_xcconfig_namespaced_keys(public_xcconfig.to_hash, config, target.xcconfig_prefix) xcconfig_hash = add_xcconfig_namespaced_keys(public_xcconfig.to_hash, config, target.xcconfig_prefix)
@xcconfig = Xcodeproj::Config.new(xcconfig_hash) @xcconfig = Xcodeproj::Config.new(xcconfig_hash)
XCConfigHelper.add_language_specific_settings(target, @xcconfig)
@xcconfig.includes = [target.name] @xcconfig.includes = [target.name]
@xcconfig @xcconfig
end end
......
...@@ -88,6 +88,24 @@ module Pod ...@@ -88,6 +88,24 @@ module Pod
xcconfig.merge!(build_settings) xcconfig.merge!(build_settings)
end end
# Checks if the given target requires language specific settings and
# configures the given Xcconfig.
#
# @param [Target] target
# The target.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
def self.add_language_specific_settings(target, xcconfig)
if target.uses_swift?
build_settings = {
'OTHER_SWIFT_FLAGS' => quote(['-D COCOAPODS']),
}
xcconfig.merge!(build_settings)
end
end
# Adds the search paths of the developer frameworks to the specification # Adds the search paths of the developer frameworks to the specification
# if needed. This is done because the `SenTestingKit` requires them and # if needed. This is done because the `SenTestingKit` requires them and
# adding them to each specification which requires it is repetitive and # adding them to each specification which requires it is repetitive and
......
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