Skip to content

Commit 8fa1b33

Browse files
authored
Merge pull request grpc#22252 from zackgalbreath/clarify_docs
Documentation improvements
2 parents 8174dbd + d99b541 commit 8fa1b33

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

BUILDING.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,23 @@ If you want to build DLLs, run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
172172

173173
### Dependency management
174174

175-
gRPC's CMake build system provides two modes for handling dependencies.
176-
* module - build dependencies alongside gRPC.
177-
* package - use external copies of dependencies that are already available
178-
on your system.
175+
gRPC's CMake build system has two options for handling dependencies.
176+
CMake can build the dependencies for you, or it can search for libraries
177+
that are already installed on your system and use them to build gRPC.
179178

180179
This behavior is controlled by the `gRPC_<depname>_PROVIDER` CMake variables,
181-
ie `gRPC_CARES_PROVIDER`.
180+
e.g. `gRPC_CARES_PROVIDER`. The options that these variables take are as follows:
181+
182+
* module - build dependencies alongside gRPC. The source code is obtained from
183+
gRPC's git submodules.
184+
* package - use external copies of dependencies that are already available
185+
on your system. These could come from your system package manager, or perhaps
186+
you pre-installed them using CMake with the `CMAKE_INSTALL_PREFIX` option.
187+
188+
For example, if you set `gRPC_CARES_PROVIDER=module`, then CMake will build
189+
c-ares before building gRPC. On the other hand, if you set
190+
`gRPC_CARES_PROVIDER=package`, then CMake will search for a copy of c-ares
191+
that's already installed on your system and use it to build gRPC.
182192

183193
### Install after build
184194

src/cpp/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,26 @@ also sets up an `add_subdirectory()` rule for you. This causes gRPC to be
7070
built as part of your project.
7171

7272
```cmake
73+
cmake_minimum_required(VERSION 3.15)
74+
project(my_project)
75+
7376
include(FetchContent)
7477
FetchContent_Declare(
7578
gRPC
7679
GIT_REPOSITORY https://github.com/grpc/grpc
77-
GIT_TAG v1.25.0
80+
GIT_TAG RELEASE_TAG_HERE # e.g v1.28.0
7881
)
82+
set(FETCHCONTENT_QUIET OFF)
7983
FetchContent_MakeAvailable(gRPC)
8084
8185
add_executable(my_exe my_exe.cc)
8286
target_link_libraries(my_exe grpc++)
8387
```
8488

89+
Note that you need to
90+
[install the prerequisites](../../BUILDING.md#pre-requisites)
91+
before building gRPC.
92+
8593
### git submodule
8694
If you cannot use FetchContent, another approach is to add the gRPC source tree
8795
to your project as a

0 commit comments

Comments
 (0)