Generate Pods target in Mac OS X with the specified deployment target.

Fix #757
parent c37de717
......@@ -116,5 +116,12 @@ module Pod
def requires_legacy_ios_archs?
(name == :ios) && deployment_target && (deployment_target < Version.new("4.3"))
end
def deployment_target_setting_name
case @symbolic_name
when :ios then 'IPHONEOS_DEPLOYMENT_TARGET'
when :osx then 'MACOSX_DEPLOYMENT_TARGET'
end
end
end
end
......@@ -63,9 +63,8 @@ module Pod
settings['ARCHS'] = "armv6 armv7"
end
if platform == :ios && platform.deployment_target
# TODO: add for osx as well
settings['IPHONEOS_DEPLOYMENT_TARGET'] = platform.deployment_target.to_s
if platform.deployment_target
settings[platform.deployment_target_setting_name] = platform.deployment_target.to_s
end
target.build_settings('Debug').merge!(settings)
......
......@@ -90,4 +90,20 @@ describe 'Pod::Project' do
target.build_settings('Release')["IPHONEOS_DEPLOYMENT_TARGET"].should == "4.0"
end
end
describe "concerning its :osx targets with a deployment target" do
before do
@project = Pod::Project.new
end
it "sets MACOSX_DEPLOYMENT_TARGET for both configurations" do
target = @project.add_pod_target('Pods', Pod::Platform.new(:osx))
target.build_settings('Debug')["MACOSX_DEPLOYMENT_TARGET"].should == "10.7"
target.build_settings('Release')["MACOSX_DEPLOYMENT_TARGET"].should == "10.7"
target = @project.add_pod_target('Pods', Pod::Platform.new(:osx, :deployment_target => "10.6"))
target.build_settings('Debug')["MACOSX_DEPLOYMENT_TARGET"].should == "10.6"
target.build_settings('Release')["MACOSX_DEPLOYMENT_TARGET"].should == "10.6"
end
end
end
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