Skip to content

Commit 8db108c

Browse files
authored
Document the steps for building & installing the project for macOS using CMake (#835)
This adds documentation to `CONTRIBUTING.md` describing steps for building and installing the project for macOS using CMake. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 271bff1 commit 8db108c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

CONTRIBUTING.md

+42
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,48 @@ To learn how to run only specific tests or other testing options, run `swift
9898
test --help` to view the usage documentation.
9999
-->
100100

101+
## Using CMake to build the project for macOS
102+
103+
1. Install [CMake](https://cmake.org/) and [Ninja](https://ninja-build.org/).
104+
- See the [Installing Dependencies](https://github.com/swiftlang/swift/blob/main/docs/HowToGuides/GettingStarted.md#macos)
105+
section of the Swift [Getting Started](https://github.com/swiftlang/swift/blob/main/docs/HowToGuides/GettingStarted.md)
106+
guide for instructions.
107+
108+
1. Run the following command from the root of this repository to configure the
109+
project to build using CMake (using the Ninja generator):
110+
111+
```bash
112+
cmake -G Ninja -B build
113+
```
114+
115+
1. Run the following command to perform the build:
116+
117+
```bash
118+
cmake --build build
119+
```
120+
121+
### Installing built content using CMake
122+
123+
You can use the steps in this section to perform an install. This is primarily
124+
useful to validate the built content from this project which will be included in
125+
a Swift toolchain.
126+
127+
1. Run the following command to (re-)configure the project with an install
128+
prefix specified:
129+
130+
```bash
131+
cmake -G Ninja --install-prefix "$(pwd)/build/install" -B build
132+
```
133+
134+
1. Perform the CMake build step as described in the previous section.
135+
136+
1. Run the following command to install the built content into the
137+
`build/install/` subdirectory:
138+
139+
```bash
140+
cmake --install build
141+
```
142+
101143
## Using Docker on macOS to test for Linux
102144

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

0 commit comments

Comments
 (0)