From f915cc2b2b4f8bbd9d039c66475c76f297043465 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 16 Oct 2020 14:26:05 +0100 Subject: [PATCH] Add GN build instructions to README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30e85f8b..fa1fe601 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ The applied stage-specific rules are based on the file extension: There is also a non-shader extension * `.conf` for a configuration file of limits, see usage statement for example -## Building +## Building (CMake) Instead of building manually, you can also download the binaries for your platform directly from the [master-tot release][master-tot-release] on GitHub. @@ -184,6 +184,35 @@ cmake --build . --config Release --target install If using MSVC, after running CMake to configure, use the Configuration Manager to check the `INSTALL` project. +### Building (GN) + +glslang can also be built with the [GN build system](https://gn.googlesource.com/gn/). + +#### 1) Install `depot_tools` + +Download [depot_tools.zip](https://storage.googleapis.com/chrome-infra/depot_tools.zip), +extract to a directory, and add this directory to your `PATH`. + +#### 2) Synchronize dependencies and generate build files + +This only needs to be done once after updating `glslang`. + +With the current directory set to your `glslang` checkout, type: + +```bash +gclient sync --gclientfile=standalone.gclient +gn gen out/Default +``` + +#### 3) Build + +With the current directory set to your `glslang` checkout, type: + +```bash +cd out/Default +ninja +``` + ### If you need to change the GLSL grammar The grammar in `glslang/MachineIndependent/glslang.y` has to be recompiled with