mirror of
https://github.com/zhigang1992/CocoaPods.git
synced 2026-01-12 17:12:54 +08:00
Generate Pods target in Mac OS X with the specified deployment target.
Fix #757
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user