Commit 5d6fad7d by Corentin Wallez Committed by Commit Bot

Add build instructions for Linux and MacOS

BUG=angleproject:1368 Change-Id: I2a0852399cdf04192d7e1d11b33b2103aa173354 Reviewed-on: https://chromium-review.googlesource.com/344003Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent e8528d89
...@@ -8,20 +8,36 @@ ANGLE provides OpenGL ES 2.0 and EGL 1.4 libraries and dlls. You can use these ...@@ -8,20 +8,36 @@ ANGLE provides OpenGL ES 2.0 and EGL 1.4 libraries and dlls. You can use these
ANGLE uses git for version control. If you are not familiar with git, helpful documentation can be found at [http://git-scm.com/documentation](http://git-scm.com/documentation). ANGLE uses git for version control. If you are not familiar with git, helpful documentation can be found at [http://git-scm.com/documentation](http://git-scm.com/documentation).
### Required Tools ### Required Tools
* [Visual Studio Community 2013](http://www.visualstudio.com/downloads/download-visual-studio-vs) On all platforms:
* Required to build ANGLE on Windows and for the packaged Windows 8.1 SDK.
* [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools) * [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools)
* Required to generate projects and build files, contribute patches, run the unit tests or build the shader compiler on non-Windows systems. * Required to generate projects and build files, contribute patches, run the unit tests or build the shader compiler on non-Windows systems.
On Windows:
* [Visual Studio Community 2015 Update 2](http://www.visualstudio.com/downloads/download-visual-studio-vs)
Required to build ANGLE on Windows and for the packaged Windows 8.1 SDK.
* [Cygwin's Bison, flex, and patch](https://cygwin.com/setup-x86_64.exe) (optional) * [Cygwin's Bison, flex, and patch](https://cygwin.com/setup-x86_64.exe) (optional)
* This is only required if you need to modify GLSL ES grammar files (`glslang.l` and `glslang.y` under `src/compiler/translator`, or `ExpressionParser.y` and `Tokenizer.l` in `src/compiler/preprocessor`). This is only required if you need to modify GLSL ES grammar files (`glslang.l` and `glslang.y` under `src/compiler/translator`, or `ExpressionParser.y` and `Tokenizer.l` in `src/compiler/preprocessor`).
* Use the latest versions of bison, flex and patch from the 64-bit cygwin distribution. Use the latest versions of bison, flex and patch from the 64-bit cygwin distribution.
On Linux:
* The GCC or Clang compilers
* Development packages for OpenGL, X11 and libpci
* Bison and flex are not needed as we only support generating the translator grammar on Windows.
On MacOS:
* [XCode](https://developer.apple.com/xcode/) for Clang and development files.
* Bison and flex are not needed as we only support generating the translator grammar on Windows.
### Getting the source ### Getting the source
Set the following environment variables as needed: Set the following environment variables as needed:
On Windows:
* `GYP_GENERATORS` to `msvs` (other options include `ninja` and `make`) * `GYP_GENERATORS` to `msvs` (other options include `ninja` and `make`)
* `GYP_DEFINES` to `windows_sdk_path=YOUR_WIN_SDK_INSTALL_DIR` if you did not install the Windows 8.1 SDK in the default location. * `GYP_DEFINES` to `windows_sdk_path=YOUR_WIN_SDK_INSTALL_DIR` if you did not install the Windows 8.1 SDK in the default location.
* `GYP_MSVS_VERSION` to `2013` (or `2013e` for Express editions of MSVS) * `GYP_MSVS_VERSION` to `2015`
On Linux and MacOS:
* `GYP_GENERATORS` to `ninja` (defaults to 'make' that pollutes your source directory)
Download the ANGLE source by running the following commands: Download the ANGLE source by running the following commands:
...@@ -33,15 +49,23 @@ gclient sync ...@@ -33,15 +49,23 @@ gclient sync
git checkout master git checkout master
``` ```
Gyp will generate the main VS2013 solution file as build/ANGLE.sln. If you update ANGLE, or make a change to the projects, they can be regenerated by executing `gclient runhooks`. For generating a Windows Store version of ANGLE view the [Windows Store instructions](doc/BuildingAngleForWindowsStore.md). GYP will generate the project files, if you update ANGLE or make a change to the projects, they can be regenerated by executing `gclient runhooks`.
### Building ANGLE On Windows GYP will generate the main VS2015 solution file as build/ANGLE.sln. For generating a Windows Store version of ANGLE view the [Windows Store instructions](doc/BuildingAngleForWindowsStore.md).
On Linux and MacOS, GYP will generate the `out/Debug` and `out/Release` directories.
### Building ANGLE on Windows
1. Open one of the ANGLE Visual Studio solution files (see [Getting the source](DevSetup.md#Development-setup-Getting-the-source)). 1. Open one of the ANGLE Visual Studio solution files (see [Getting the source](DevSetup.md#Development-setup-Getting-the-source)).
2. Select Build -> Configuration Manager 2. Select Build -> Configuration Manager
3. In the "Active solution configuration:" drop down, select the desired configuration (eg. Release), and close the Configuration Manager. 3. In the "Active solution configuration:" drop down, select the desired configuration (eg. Release), and close the Configuration Manager.
4. Select Build -> Build Solution. 4. Select Build -> Build Solution.
Once the build completes, the output directory for your selected configuration (eg. `Release_Win32`, located next to the solution file) will contain the required libraries and dlls to build and run an OpenGL ES 2.0 application. Once the build completes, the output directory for your selected configuration (eg. `Release_Win32`, located next to the solution file) will contain the required libraries and dlls to build and run an OpenGL ES 2.0 application.
### Building ANGLE on Linux and MacOS
Run `ninja -C out/Debug` or `ninja -C out/Release`. Ninja is provided by `depot_tools` so make sure you set up your `PATH` correctly.
Once the build completes, the `out/Debug` or `out/Release` directories will contain the .so or .dylib libraries and test binaries.
## Application Development with ANGLE ## Application Development with ANGLE
This sections describes how to use ANGLE to build an OpenGL ES application. This sections describes how to use ANGLE to build an OpenGL ES application.
...@@ -56,6 +80,7 @@ By default, ANGLE will use a D3D11 renderer. To change the default: ...@@ -56,6 +80,7 @@ By default, ANGLE will use a D3D11 renderer. To change the default:
2. Locate the definition of `ANGLE_DEFAULT_D3D11` near the head of the file, and set it to your preference. 2. Locate the definition of `ANGLE_DEFAULT_D3D11` near the head of the file, and set it to your preference.
### To Use ANGLE in Your Application ### To Use ANGLE in Your Application
On Windows:
1. Configure your build environment to have access to the `include` folder to provide access to the standard Khronos EGL and GLES2 header files. 1. Configure your build environment to have access to the `include` folder to provide access to the standard Khronos EGL and GLES2 header files.
* For Visual C++ * For Visual C++
* Right-click your project in the _Solution Explorer_, and select _Properties_. * Right-click your project in the _Solution Explorer_, and select _Properties_.
...@@ -69,6 +94,10 @@ By default, ANGLE will use a D3D11 renderer. To change the default: ...@@ -69,6 +94,10 @@ By default, ANGLE will use a D3D11 renderer. To change the default:
3. Copy `libEGL.dll` and `libGLESv2.dll` from the build output directory (see [Building ANGLE](DevSetup.md#Building-ANGLE)) into your application folder. 3. Copy `libEGL.dll` and `libGLESv2.dll` from the build output directory (see [Building ANGLE](DevSetup.md#Building-ANGLE)) into your application folder.
4. Code your application to the Khronos [OpenGL ES 2.0](http://www.khronos.org/registry/gles/) and [EGL 1.4](http://www.khronos.org/registry/egl/) APIs. 4. Code your application to the Khronos [OpenGL ES 2.0](http://www.khronos.org/registry/gles/) and [EGL 1.4](http://www.khronos.org/registry/egl/) APIs.
On Linux and MacOS, either:
- Link you application against `libGLESv2` and `libEGL`
- Use `dlopen` to load the OpenGL ES and EGL entry points at runtime.
## GLSL ES to GLSL Translator ## GLSL ES to GLSL Translator
In addition to OpenGL ES 2.0 and EGL 1.4 libraries, ANGLE also provides a GLSL ES to GLSL translator. This is useful for implementing OpenGL ES emulators on top of desktop OpenGL. In addition to OpenGL ES 2.0 and EGL 1.4 libraries, ANGLE also provides a GLSL ES to GLSL translator. This is useful for implementing OpenGL ES emulators on top of desktop OpenGL.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment