@ -41,7 +41,7 @@ If you plan to build from source and run tests, install the following as well:
$ brew install gflags
```
*Tip*: when building,
*Tip*: when building,
you *may* want to explicitly set the `LIBTOOL` and `LIBTOOLIZE`
environment variables when running `make` to ensure the version
installed by `brew` is being used:
@ -63,7 +63,7 @@ To prepare for cmake + Microsoft Visual C++ compiler build
# Clone the repository (including submodules)
Before building, you need to clone the gRPC github repository and download submodules containing source code
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 or `--recursive` flag). The following commands will clone the gRPC
repository at the latest stable version.
@ -116,7 +116,9 @@ $ bazel test --config=dbg //test/...
NOTE: If you are gRPC maintainer and you have access to our test cluster, you should use the our [gRPC's Remote Execution environment](tools/remote_build/README.md)
to get significant improvement to the build and test speed (and a bunch of other very useful features).
## CMake: Linux/Unix, Using Make
## Building with CMake
### Linux/Unix, Using Make
Run from grpc directory after cloning the repo with --recursive or updating submodules.
```
@ -128,12 +130,12 @@ $ make
If you want to build shared libraries (`.so` files), run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
## Building with CMake: Windows, Using Visual Studio 2015 or 2017 (can only build with OPENSSL_NO_ASM).
### Windows, Using Visual Studio 2015 or 2017
When using the "Visual Studio" generator,
cmake will generate a solution (`grpc.sln`) that contains a VS project for
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
added automatically by cmake). After opening the solution with Visual Studio
you will be able to browse and build the code.
```
> @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
@ -143,7 +145,9 @@ you will be able to browse and build the code.
> cmake --build . --config Release
```
## Building with CMake: Windows, Using Ninja (faster build, supports boringssl's assembly optimizations).
If you want to build DLLs, run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
### Windows, Using Ninja (faster build).
Please note that when using Ninja, you will still need Visual C++ (part of Visual Studio)
installed to be able to compile the C/C++ sources.
@ -156,7 +160,67 @@ installed to be able to compile the C/C++ sources.
> cmake --build .
```
## Building with make (on UNIX systems)
If you want to build DLLs, run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
### Dependency management
gRPC's CMake build system provides two modes for handling dependencies.
* module - build dependencies alongside gRPC.
* package - use external copies of dependencies that are already available
on your system.
This behavior is controlled by the `gRPC_<depname>_PROVIDER` CMake variables,
ie `gRPC_CARES_PROVIDER`.
### Install after build
Perform the following steps to install gRPC using CMake.
## Building with make on UNIX systems (deprecated)
NOTE: `make` used to be gRPC's default build system, but we're no longer recommending it. You should use `bazel` or `cmake` instead. The `Makefile` is only intended for internal usage and is not meant for public consumption.