|
|
|
@ -94,42 +94,51 @@ on experience with the tools involved. |
|
|
|
|
### Building using CMake (RECOMMENDED) |
|
|
|
|
|
|
|
|
|
Builds gRPC C and C++ with boringssl. |
|
|
|
|
- Install [Git](https://git-scm.com/). |
|
|
|
|
- Install Visual Studio 2015 or 2017 (Visual C++ compiler will be used). |
|
|
|
|
- Install [Git](https://git-scm.com/). |
|
|
|
|
- Install [CMake](https://cmake.org/download/). |
|
|
|
|
- Install [Active State Perl](https://www.activestate.com/activeperl/) (`choco install activeperl`) |
|
|
|
|
- Install [Ninja](https://ninja-build.org/) (`choco install ninja`) |
|
|
|
|
- Install [Go](https://golang.org/dl/) (`choco install golang`) |
|
|
|
|
- Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`) |
|
|
|
|
- Run these commands in the repo root directory |
|
|
|
|
|
|
|
|
|
#### cmake: Using Ninja (faster build, supports boringssl's assembly optimizations). |
|
|
|
|
Please note that when using Ninja, you'll still need Visual C++ (part of Visual Studio) |
|
|
|
|
installed to be able to compile the C/C++ sources. |
|
|
|
|
- Install [Active State Perl](https://www.activestate.com/activeperl/) (`choco install activeperl`) - *required by boringssl* |
|
|
|
|
- Install [Go](https://golang.org/dl/) (`choco install golang`) - *required by boringssl* |
|
|
|
|
- Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`) - *required by boringssl* |
|
|
|
|
- (Optional) Install [Ninja](https://ninja-build.org/) (`choco install ninja`) |
|
|
|
|
|
|
|
|
|
#### Clone grpc sources including submodules |
|
|
|
|
Before building, you need to clone the gRPC github repository and download submodules containing source code |
|
|
|
|
for gRPC's dependencies (that's done by the `submodule` command). |
|
|
|
|
``` |
|
|
|
|
> powershell git clone --recursive -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc |
|
|
|
|
> @rem You can also do just "git clone -b THE_BRANCH_YOU_WANT https://github.com/grpc/grpc" |
|
|
|
|
> powershell git clone -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc |
|
|
|
|
> cd grpc |
|
|
|
|
> md .build |
|
|
|
|
> cd .build |
|
|
|
|
> call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64 |
|
|
|
|
> cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release |
|
|
|
|
> cmake --build . |
|
|
|
|
> ninja |
|
|
|
|
> git submodule update --init |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
#### cmake: Using Visual Studio 2015 (can only build with OPENSSL_NO_ASM). |
|
|
|
|
#### cmake: Using Visual Studio 2015 or 2017 (can only build with OPENSSL_NO_ASM). |
|
|
|
|
When using the "Visual Studio" generator, |
|
|
|
|
cmake will generate a solution (`grpc.sln`) that contains a VS project for |
|
|
|
|
every target defined in `CMakeLists.txt` (+ few extra convenience projects |
|
|
|
|
added automatically by cmake). After opening the solution with Visual Studio |
|
|
|
|
you will be able to browse and build the code as usual. |
|
|
|
|
``` |
|
|
|
|
> @rem Run from grpc directory after cloning the repo and submodules. |
|
|
|
|
> md .build |
|
|
|
|
> cd .build |
|
|
|
|
> cmake .. -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=Release |
|
|
|
|
> cmake --build . |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
#### cmake: Using Ninja (faster build, supports boringssl's assembly optimizations). |
|
|
|
|
Please note that when using Ninja, you'll still need Visual C++ (part of Visual Studio) |
|
|
|
|
installed to be able to compile the C/C++ sources. |
|
|
|
|
``` |
|
|
|
|
> @rem Run from grpc directory after cloning the repo and submodules. |
|
|
|
|
> md .build |
|
|
|
|
> cd .build |
|
|
|
|
> call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64 |
|
|
|
|
> cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release |
|
|
|
|
> cmake --build . |
|
|
|
|
> ninja |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
### msys2 (with mingw) |
|
|
|
|
|
|
|
|
|
The Makefile (and source code) should support msys2's mingw32 and mingw64 |
|
|
|
|