[swift-dev] Specify Xcode command line tools when building Swift?

Daniel Dunbar daniel_dunbar at apple.com
Mon Sep 19 10:35:23 CDT 2016


> On Sep 19, 2016, at 8:24 AM, Brian Gesiak via swift-dev <swift-dev at swift.org> wrote:
> 
> Hello all,
> 
> I have two copies of Xcode on my development machine: /Applications/Xcode-7.3.1.app and /Applications/Xcode.app (which is Xcode 8.0).
> 
> I have `Xcode > Preferences... > Locations > Command Line Tools` set to /Applications/Xcode-7.3.1.app, since I need Xcode 7.3.1 to build a different project that I'm working on.
> 
> However, apple/swift only builds using Xcode 8. I could change my `Locations > Command Line Tools` whenever I build apple/swift, but that's inconvenient -- I build both apple/swift and my other project several times per day, so I would have to switch very often.
> 
> Is it possible to specify an Xcode command line tools location when building Swift? So far I'm doing this, and it appears to be working:
> 
>     DEVELOPER_DIR=/Applications/Xcode.app utils/build-script -R
> 
> Is this a good way to build using a specific version of Xcode? Or is there a better way? Should we support this via an additional option to utils/build-script, such as `utils/build-script --xcode=/Applications/Xcode.app`?

Yes, this is a fine way, and the intended use of DEVELOPER_DIR. I'm not sure it deserves an argument on its own, but if that would help discoverability then it might be worth it.

 - Daniel

> 
> Thoughts and feedback appreciated!
> 
> - Brian Gesiak
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev



More information about the swift-dev mailing list