Commit 70036af6 authored by Samuel Giddins's avatar Samuel Giddins

[AggregateTargetSettings] Include OTHER_SWIFT_FLAGS even when there are no swift pods

parent 5e7cb988
...@@ -277,9 +277,17 @@ module Pod ...@@ -277,9 +277,17 @@ module Pod
# @!group Swift # @!group Swift
# @return [Boolean]
# Whether `OTHER_SWIFT_FLAGS` should be generated when the target
# does not use swift.
#
def other_swift_flags_without_swift?
false
end
# @return [Array<String>] # @return [Array<String>]
define_build_settings_method :other_swift_flags, :build_setting => true, :memoized => true do define_build_settings_method :other_swift_flags, :build_setting => true, :memoized => true do
return unless target.uses_swift? return unless target.uses_swift? || other_swift_flags_without_swift?
flags = %w(-D COCOAPODS) flags = %w(-D COCOAPODS)
flags.concat module_map_files.flat_map { |f| ['-Xcc', "-fmodule-map-file=#{f}"] } flags.concat module_map_files.flat_map { |f| ['-Xcc', "-fmodule-map-file=#{f}"] }
flags flags
...@@ -931,6 +939,11 @@ module Pod ...@@ -931,6 +939,11 @@ module Pod
# @!group Swift # @!group Swift
# @see BuildSettings#other_swift_flags_without_swift?
def other_swift_flags_without_swift?
module_map_files.any?
end
# @return [Array<String>] # @return [Array<String>]
define_build_settings_method :swift_include_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :swift_include_paths_to_import do define_build_settings_method :swift_include_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :swift_include_paths_to_import do
[] []
......
Subproject commit 6d513c5e91d77b79384bde41f760eef2482e3357 Subproject commit 2faa5dd550afc3158b119ebc1fe90eea5fa15825
...@@ -158,6 +158,13 @@ module Pod ...@@ -158,6 +158,13 @@ module Pod
@xcconfig.to_hash['OTHER_CFLAGS'].should == expected @xcconfig.to_hash['OTHER_CFLAGS'].should == expected
end end
it 'adds the dependent pods module map file to OTHER_SWIFT_FLAGS' do
@pod_targets.each { |pt| pt.stubs(:defines_module? => true) }
@xcconfig = @generator.generate
expected = '$(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Private/BananaLib/BananaLib.modulemap"'
@xcconfig.to_hash['OTHER_SWIFT_FLAGS'].should == expected
end
describe 'with a scoped pod target' do describe 'with a scoped pod target' do
def pod_target(spec, target_definition) def pod_target(spec, target_definition)
fixture_pod_target(spec, false, {}, [], Platform.new(:ios, '6.0'), [target_definition]).scoped.first fixture_pod_target(spec, false, {}, [], Platform.new(:ios, '6.0'), [target_definition]).scoped.first
......
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