Commit b28b70aa authored by Marius Rackwitz's avatar Marius Rackwitz

[XCConfig] Don't apply pod_target_xcconfig to aggregate target

Fixes #3906.
parent 3ff30dc6
...@@ -66,6 +66,9 @@ module Pod ...@@ -66,6 +66,9 @@ module Pod
@xcconfig = Xcodeproj::Config.new(config) @xcconfig = Xcodeproj::Config.new(config)
XCConfigHelper.add_settings_for_file_accessors_of_target(target, @xcconfig) XCConfigHelper.add_settings_for_file_accessors_of_target(target, @xcconfig)
target.file_accessors.each do |file_accessor|
@xcconfig.merge!(file_accessor.spec_consumer.pod_target_xcconfig)
end
XCConfigHelper.add_target_specific_settings(target, @xcconfig) XCConfigHelper.add_target_specific_settings(target, @xcconfig)
@xcconfig @xcconfig
end end
......
...@@ -71,7 +71,6 @@ module Pod ...@@ -71,7 +71,6 @@ module Pod
# The xcconfig to edit. # The xcconfig to edit.
# #
def self.add_spec_build_settings_to_xcconfig(consumer, xcconfig) def self.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.merge!(consumer.pod_target_xcconfig)
xcconfig.libraries.merge(consumer.libraries) xcconfig.libraries.merge(consumer.libraries)
xcconfig.frameworks.merge(consumer.frameworks) xcconfig.frameworks.merge(consumer.frameworks)
xcconfig.weak_frameworks.merge(consumer.weak_frameworks) xcconfig.weak_frameworks.merge(consumer.weak_frameworks)
......
...@@ -14,6 +14,8 @@ module Pod ...@@ -14,6 +14,8 @@ module Pod
before do before do
@spec = spec @spec = spec
@spec.user_target_xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' }
@spec.pod_target_xcconfig = { 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11' }
@pod_target = pod_target(@spec) @pod_target = pod_target(@spec)
@consumer = @pod_target.spec_consumers.last @consumer = @pod_target.spec_consumers.last
@target = fixture_aggregate_target([@pod_target]) @target = fixture_aggregate_target([@pod_target])
...@@ -38,6 +40,11 @@ module Pod ...@@ -38,6 +40,11 @@ module Pod
@xcconfig.class.should == Xcodeproj::Config @xcconfig.class.should == Xcodeproj::Config
end end
it 'includes only the user_target_xcconfig of the specifications' do
@xcconfig.to_hash['CLANG_CXX_LANGUAGE_STANDARD'].should.be.nil
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-no_compact_unwind')
end
it 'does not add the -fobjc-arc to OTHER_LDFLAGS by default as Xcode 4.3.2 does not support it' do it 'does not add the -fobjc-arc to OTHER_LDFLAGS by default as Xcode 4.3.2 does not support it' do
@consumer.stubs(:requires_arc?).returns(true) @consumer.stubs(:requires_arc?).returns(true)
@xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include('-fobjc-arc') @xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include('-fobjc-arc')
......
...@@ -12,7 +12,8 @@ module Pod ...@@ -12,7 +12,8 @@ module Pod
@podfile = @pod_target.podfile @podfile = @pod_target.podfile
@generator = PodXCConfig.new(@pod_target) @generator = PodXCConfig.new(@pod_target)
@spec.xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' } @spec.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' }
@spec.user_target_xcconfig = { 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11' }
@spec.frameworks = ['QuartzCore'] @spec.frameworks = ['QuartzCore']
@spec.weak_frameworks = ['iAd'] @spec.weak_frameworks = ['iAd']
@spec.libraries = ['xml2'] @spec.libraries = ['xml2']
...@@ -29,7 +30,8 @@ module Pod ...@@ -29,7 +30,8 @@ module Pod
@xcconfig.class.should == Xcodeproj::Config @xcconfig.class.should == Xcodeproj::Config
end end
it 'includes the xcconfig of the specifications' do it 'includes only the pod_target_xcconfig of the specifications' do
@xcconfig.to_hash['CLANG_CXX_LANGUAGE_STANDARD'].should.be.nil
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-no_compact_unwind') @xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-no_compact_unwind')
end end
......
...@@ -50,19 +50,6 @@ module Pod ...@@ -50,19 +50,6 @@ module Pod
#---------------------------------------------------------------------# #---------------------------------------------------------------------#
describe '::add_spec_build_settings_to_xcconfig' do describe '::add_spec_build_settings_to_xcconfig' do
it 'adds the build settings of the consumer' do
xcconfig = Xcodeproj::Config.new
consumer = stub(
:pod_target_xcconfig => { 'OTHER_LDFLAGS' => '-framework SenTestingKit' },
:libraries => [],
:frameworks => [],
:weak_frameworks => [],
:platform_name => :ios,
)
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "SenTestingKit"'
end
it 'adds the libraries of the xcconfig' do it 'adds the libraries of the xcconfig' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
consumer = stub( consumer = stub(
......
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