Skip to content

Commit

Permalink
Add a commentary on C++ Windows DLL builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch authored Jan 29, 2021
1 parent f6f75a6 commit 461b086
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ you will be able to browse and build the code.
> cmake --build . --config Release
```

If you want to build DLLs, run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
Using gRPC C++ as a DLL is not recommended, but you can still enable it by running `cmake` with `-DBUILD_SHARED_LIBS=ON`.

### Windows, Using Ninja (faster build).

Expand All @@ -160,7 +160,16 @@ installed to be able to compile the C/C++ sources.
> cmake --build .
```

If you want to build DLLs, run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
Using gRPC C++ as a DLL is not recommended, but you can still enable it by running `cmake` with `-DBUILD_SHARED_LIBS=ON`.

### Windows: A note on building shared libs (DLLs)

Windows DLL build is supported at a "best effort" basis and we don't recommend using gRPC C++ as a DLL as there are some known drawbacks around how C++ DLLs work on Windows. For example, there is no stable C++ ABI and you can't safely allocate memory in one DLL, and free it in another etc.

That said, we don't actively prohibit building DLLs on windows (it can be enabled in cmake with `-DBUILD_SHARED_LIBS=ON`), and are free to use the DLL builds
at your own risk.
- you've been warned that there are some important drawbacks and some things might not work at all or will be broken in interesting ways.
- we don't have extensive testing for DLL builds in place (to avoid maintenance costs, increased test duration etc.) so regressions / build breakages might occur

### Dependency management

Expand Down

0 comments on commit 461b086

Please sign in to comment.