# Building Swift on OSX

DevFeed: [Building Swift on OSX](<https://devfeed.tech/articles/building-swift-on-osx-21609.md>)

Original publisher: [Read original article](<http://miqu.me/blog/2015/12/05/building-swift-on-osx/>)

Author: Miguel Angel Quiñones

Published: 2015-12-05T00:38:35Z

Content type: tutorial

Language: en

Sources: [Miguel Quinones](<https://devfeed.tech/sources/miguel-quinones.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [CMake](<https://devfeed.tech/topics/cmake.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Homebrew](<https://devfeed.tech/topics/homebrew.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [cmake](<https://devfeed.tech/tags/cmake.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [developer](<https://devfeed.tech/tags/developer.md>), [getting-started](<https://devfeed.tech/tags/getting-started.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [swift](<https://devfeed.tech/tags/swift.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

## AI overview

A tutorial on building the open-source Swift runtime, REPL, and compiler on macOS. It covers using a binary development snapshot or compiling from source with CMake, Ninja, and Homebrew, and explains that the resulting build artifacts are placed in a build folder.

## Source excerpt

Swift is finally open source! This is great because of many reasons, namely the transparency and chances to learn from the people responsible of building the foundational language you work on. I've been checking how easy was to build the runtime, REPL and compiler, and it turns out the team made an excellent job to make the process very easy. Let's see how to do it. If you ever want to use a bleeding edge version of swift to build your application, now you can! Bear in mind that you should only use development versions of the compiler and runtime only when you are sure you need to do this. Generally as an application developer you rarely need to do so. But hey, let's dive in! The documentation is very good. Again the team has done an excellent job in my opinion, setting up a full open source setup for the years to come. So I encourage you to read at least the getting started and readme first. Downloading a binary development snapshot If you don't want to build from sources, you can grab the latest snapshot as described on the swift download page. It's certainly an option if for example you have an application written in Swift, and you want to assess how much things will change ahead of next Xcode release. You can check Erica Sadun's post if you want more details. Thanks Erica for sharing! Building from sources I just needed to install two dependencies on my machine, as stated in the repository: cmake and ninja. Be sure to set this up before starting a build. I'm using homebrew: 1 2 brew install cmake brew install ninja I chose to use ninja for the first time I would build Swift, as it is the default build system, and I wouldn't need to change configuration parameters for the build script. Once you've installed the dependencies, clone the required repositories. Bear in mind that the default build script will try to look for more than just the swift repository. As described in the swift README. So you'll need to clone several repos: 1 2 3 4 5 6 7 8 9 10 mkdir apple gi