Skip to content

Document the steps for building & installing the project for macOS using CMake #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,48 @@ To learn how to run only specific tests or other testing options, run `swift
test --help` to view the usage documentation.
-->

## Using CMake to build the project for macOS

1. Install [CMake](https://cmake.org/) and [Ninja](https://ninja-build.org/).
- See the [Installing Dependencies](https://github.com/swiftlang/swift/blob/main/docs/HowToGuides/GettingStarted.md#macos)
section of the Swift [Getting Started](https://github.com/swiftlang/swift/blob/main/docs/HowToGuides/GettingStarted.md)
guide for instructions.

1. Run the following command from the root of this repository to configure the
project to build using CMake (using the Ninja generator):

```bash
cmake -G Ninja -B build
```

1. Run the following command to perform the build:

```bash
cmake --build build
```

### Installing built content using CMake

You can use the steps in this section to perform an install. This is primarily
useful to validate the built content from this project which will be included in
a Swift toolchain.

1. Run the following command to (re-)configure the project with an install
prefix specified:

```bash
cmake -G Ninja --install-prefix "$(pwd)/build/install" -B build
```

1. Perform the CMake build step as described in the previous section.

1. Run the following command to install the built content into the
`build/install/` subdirectory:

```bash
cmake --install build
```

## Using Docker on macOS to test for Linux

1. Install [Docker Desktop for Mac](https://www.docker.com/products/docker-desktop).
Expand Down