1# How to build ANGLE in Chromium for dev 2 3## Introduction 4 5On Windows, Linux, and Mac ANGLE now builds most core components cross platform, including the shader validator and translator as well as the graphics API translator. These parts can be built and tested inside a Chromium checkout. 6 7ANGLE also includes some sample applications and a few other targets that don't build on Chromium. These steps describe how to build such targets within a Chromium checkout. 8 9Prerequisite Steps: 10 11 * Checkout and build [Chromium](http://dev.chromium.org/Home). 12 * To setup run these commands (note similarity to [DevSetup](DevSetup.md)): 13 14## Standalone ANGLE inside Chromium 15 16 * To sync all standalone dependencies run: 17 18```bash 19cd src/third_party/angle 20python3 scripts/bootstrap.py 21gclient sync 22``` 23 24 * To generate ANGLE standalone build files run: 25 26```bash 27cd src/third_party/angle 28gn gen out/Debug 29``` 30 31 * To build: 32 33```bash 34cd src/third_party/angle 35ninja -j 10 -k1 -C out/Debug 36``` 37 38 * For example, `ninja -j 10 -k1 -C out/Debug angle_gles2_deqp_tests` 39 * To run a sample application: `./out/Debug/hello_triangle` 40 * To go back to the Chromium-managed version, remove `third_party/angle/.gclient`. 41 42## Working with ANGLE in Chromium 43 44You will also want to work with a local version of ANGLE instead of the version that is pulled in by Chromium's [DEPS](https://chromium.googlesource.com/chromium/src/+/main/DEPS) file. To do this do the following: 45 46 * cd to `chromium/`. One directory above `chromium/src`. Add this to `chromium/.gclient`: 47 48```python 49solutions = [ 50 { 51 # ... 52 u'custom_deps': 53 { 54 "src/third_party/angle": None, 55 }, 56 }, 57] 58``` 59 60You will have full control over your ANGLE workspace and are responsible for running all git commands (pull, rebase, etc.) for managing your branches. 61 62If you decide you need to go back to the DEPS version of ANGLE: 63 64 * Comment out or remove the `src/third_party/angle` line in your `custom_deps` in `chomium/.gclient`. 65 * Se the ANGLE workspace to the version specified in Chromium's DEPS. Ensure there are no modified or new files. 66 * `gclient sync` your Chromium workspace. 67