Merge pull request #22252 from zackgalbreath/clarify_docs

Documentation improvements
pull/22896/head
Jan Tattermusch 5 years ago committed by GitHub
commit 8fa1b33c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      BUILDING.md
  2. 10
      src/cpp/README.md

@ -172,13 +172,23 @@ 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.
gRPC's CMake build system has two options for handling dependencies.
CMake can build the dependencies for you, or it can search for libraries
that are already installed on your system and use them to build gRPC.
This behavior is controlled by the `gRPC_<depname>_PROVIDER` CMake variables,
ie `gRPC_CARES_PROVIDER`.
e.g. `gRPC_CARES_PROVIDER`. The options that these variables take are as follows:
* module - build dependencies alongside gRPC. The source code is obtained from
gRPC's git submodules.
* package - use external copies of dependencies that are already available
on your system. These could come from your system package manager, or perhaps
you pre-installed them using CMake with the `CMAKE_INSTALL_PREFIX` option.
For example, if you set `gRPC_CARES_PROVIDER=module`, then CMake will build
c-ares before building gRPC. On the other hand, if you set
`gRPC_CARES_PROVIDER=package`, then CMake will search for a copy of c-ares
that's already installed on your system and use it to build gRPC.
### Install after build

@ -70,18 +70,26 @@ also sets up an `add_subdirectory()` rule for you. This causes gRPC to be
built as part of your project.
```cmake
cmake_minimum_required(VERSION 3.15)
project(my_project)
include(FetchContent)
FetchContent_Declare(
gRPC
GIT_REPOSITORY https://github.com/grpc/grpc
GIT_TAG v1.25.0
GIT_TAG RELEASE_TAG_HERE # e.g v1.28.0
)
set(FETCHCONTENT_QUIET OFF)
FetchContent_MakeAvailable(gRPC)
add_executable(my_exe my_exe.cc)
target_link_libraries(my_exe grpc++)
```
Note that you need to
[install the prerequisites](../../BUILDING.md#pre-requisites)
before building gRPC.
### git submodule
If you cannot use FetchContent, another approach is to add the gRPC source tree
to your project as a

Loading…
Cancel
Save