Xcode macOS Deployment Target version


(Ryan Lovelett) #1

Is there away to tell SwiftPM to specify the deployment target when
generating an Xcode project? Right now I'm having to manually go in and
set the deployment target to 10.11 myself.

It apparently defaults to macOS 10.10. Which in and of itself seems
weird to me considering that Swift 3 requires Xcode 8 and Xcode 8
requires a Mac running macOS Sierra 10.12 or OS X El Capitan 10.11.5 or
later. So I figured it would at least default to 10.11.


(Keith Smiley) #2

Currently you can do this by passing the `--xcconfig-overrides` flag,
along with an `xcconfig` file to the `generate-xcodeproj` command. For
your case you can simply create an `xcconfig` file containing:

MACOSX_DEPLOYMENT_TARGET = 10.11

Note that there were some bugs around this recently in swiftpm, so you
need Xcode 8.2 (currently in beta) for this to work correctly, the
settings precedence is incorrect in Xcode 8.1

Full example usage:

swift package generate-xcodeproj --xcconfig-overrides settings.xcconfig
ยทยทยท

--
Keith Smiley

On 11/25, Ryan Lovelett via swift-build-dev wrote:

Is there away to tell SwiftPM to specify the deployment target when
generating an Xcode project? Right now I'm having to manually go in and
set the deployment target to 10.11 myself.

It apparently defaults to macOS 10.10. Which in and of itself seems
weird to me considering that Swift 3 requires Xcode 8 and Xcode 8
requires a Mac running macOS Sierra 10.12 or OS X El Capitan 10.11.5 or
later. So I figured it would at least default to 10.11.
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev


(Ryan Lovelett) #3

So awesome. So simple. Thank you Keith.

ยทยทยท

On Fri, Nov 25, 2016, at 11:58 PM, Keith Smiley wrote:

Currently you can do this by passing the `--xcconfig-overrides` flag,
along with an `xcconfig` file to the `generate-xcodeproj` command. For
your case you can simply create an `xcconfig` file containing:

MACOSX_DEPLOYMENT_TARGET = 10.11

Note that there were some bugs around this recently in swiftpm, so you
need Xcode 8.2 (currently in beta) for this to work correctly, the
settings precedence is incorrect in Xcode 8.1

Full example usage:

swift package generate-xcodeproj --xcconfig-overrides settings.xcconfig

--
Keith Smiley

On 11/25, Ryan Lovelett via swift-build-dev wrote:
> Is there away to tell SwiftPM to specify the deployment target when
> generating an Xcode project? Right now I'm having to manually go in and
> set the deployment target to 10.11 myself.
>
> It apparently defaults to macOS 10.10. Which in and of itself seems
> weird to me considering that Swift 3 requires Xcode 8 and Xcode 8
> requires a Mac running macOS Sierra 10.12 or OS X El Capitan 10.11.5 or
> later. So I figured it would at least default to 10.11.
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev