Skip to content

Commit bbef25c

Browse files
authored
Update build steps for MacOS (shader-slang#4813)
This commit adds a quick build step for MacOS on CONTRIBUTION.md. It is unclear what are the conditions that slang-llvm needs to be rebuilt locally. An issue is filed for it, shader-slang#4812
1 parent 127f0c5 commit bbef25c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

CONTRIBUTION.md

+36
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,42 @@ Build with a following command:
105105
$ cmake --build --preset release
106106
```
107107

108+
#### MacOS
109+
Install XCode from AppStore.
110+
111+
Install CMake and Ninja; we recommend using [homebrew](https://brew.sh/) for installing them.
112+
```
113+
brew install ninja
114+
brew install cmake
115+
```
116+
117+
Run CMake with a following command to generate Makefile:
118+
```
119+
$ cmake --preset default
120+
```
121+
122+
Build with a following command:
123+
```
124+
$ cmake --build --preset release
125+
```
126+
127+
#### MacOS with slang-llvm local build
128+
slang-llvm is required to run slang-test properly.
129+
Depending on your hardware, your slang-llvm may need to be locally rebuilt with the following command.
130+
```
131+
external/build-llvm.sh --source-dir=build/slang-llvm_src --install-prefix=build/slang-llvm_install
132+
```
133+
134+
You need to use the following command to re-generate Makefile,
135+
```
136+
$ cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM -DLLVM_DIR=build/slang-llvm_install/lib/cmake/llvm -DClang_DIR=build/slang-llvm_install/lib/cmake/clang
137+
```
138+
139+
Build with a following command:
140+
```
141+
$ cmake --build --preset release
142+
```
143+
108144
### Making Changes
109145
Make your changes and ensure to follow our [Design Decisions](docs/design/README.md).
110146

0 commit comments

Comments
 (0)