Skip to content

Commit

Permalink
[TargetInstaller] Create unique hash instances for the build settings
Browse files Browse the repository at this point in the history
Closes #1014
  • Loading branch information
fabiopelosin committed Apr 30, 2013
1 parent 825ab99 commit 1238317
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cocoapods/installer/target_installer.rb
Expand Up @@ -80,7 +80,7 @@ def add_target
unless @target.build_configurations.map(&:name).include?(bc_name)
build_config = project.new(Xcodeproj::Project::XCBuildConfiguration)
build_config.name = bc_name
settings = @target.build_settings(type.to_s.capitalize)
settings = @target.build_settings(type.to_s.capitalize).dup
build_config.build_settings = settings
target.build_configurations << build_config
end
Expand Down
8 changes: 7 additions & 1 deletion spec/unit/installer/target_installer_spec.rb
Expand Up @@ -105,7 +105,7 @@ module Pod
it "adds the settings of the xcconfig that need to be overridden to the target" do
@installer.install!
build_configuration = @project.targets.first.build_configurations
build_settings = build_configuration.first.build_settings
build_settings = build_configuration.first.build_settings
Generator::XCConfig.pods_project_settings.each do |key, value|
build_settings[key].should == value
end
Expand All @@ -116,6 +116,12 @@ module Pod
@project.targets.first.build_configurations.map(&:name).sort.should == %w{ AppStore Debug Release Test }
end

it "it creates different hash instances for the build settings of various build configurations" do
@installer.install!
build_settings = @project.targets.first.build_configurations.map(&:build_settings)
build_settings.map(&:object_id).uniq.count.should == 4
end

it "does not enable the GCC_WARN_INHIBIT_ALL_WARNINGS flag by default" do
@installer.install!
@installer.library.target.build_configurations.each do |config|
Expand Down

0 comments on commit 1238317

Please sign in to comment.