Skip to content

Commit f915cc2

Browse files
committed
Add GN build instructions to README.md
1 parent dac38b8 commit f915cc2

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The applied stage-specific rules are based on the file extension:
8888
There is also a non-shader extension
8989
* `.conf` for a configuration file of limits, see usage statement for example
9090

91-
## Building
91+
## Building (CMake)
9292

9393
Instead of building manually, you can also download the binaries for your
9494
platform directly from the [master-tot release][master-tot-release] on GitHub.
@@ -184,6 +184,35 @@ cmake --build . --config Release --target install
184184
If using MSVC, after running CMake to configure, use the
185185
Configuration Manager to check the `INSTALL` project.
186186

187+
### Building (GN)
188+
189+
glslang can also be built with the [GN build system](https://gn.googlesource.com/gn/).
190+
191+
#### 1) Install `depot_tools`
192+
193+
Download [depot_tools.zip](https://storage.googleapis.com/chrome-infra/depot_tools.zip),
194+
extract to a directory, and add this directory to your `PATH`.
195+
196+
#### 2) Synchronize dependencies and generate build files
197+
198+
This only needs to be done once after updating `glslang`.
199+
200+
With the current directory set to your `glslang` checkout, type:
201+
202+
```bash
203+
gclient sync --gclientfile=standalone.gclient
204+
gn gen out/Default
205+
```
206+
207+
#### 3) Build
208+
209+
With the current directory set to your `glslang` checkout, type:
210+
211+
```bash
212+
cd out/Default
213+
ninja
214+
```
215+
187216
### If you need to change the GLSL grammar
188217

189218
The grammar in `glslang/MachineIndependent/glslang.y` has to be recompiled with

0 commit comments

Comments
 (0)