Skip to content

Commit 7ae64d3

Browse files
authored
Update CMake build docs for Windows (#4440)
1 parent c2fa88e commit 7ae64d3

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

CMAKE.md

+24-11
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the Mac App Store.
2727
You can get other development tools via [homebrew](https://brew.sh). Adjust as
2828
needed for other package managers.
2929

30-
```
30+
```bash
3131
brew install cmake
3232
brew install golang
3333
brew install ccache # optional
@@ -44,7 +44,7 @@ need to be set up and no `pod install` is required for the CMake build.
4444
If you're on a relatively recent Linux, the system-provided CMake may be
4545
sufficient.
4646

47-
```
47+
```bash
4848
sudo apt-get install build-essential
4949
sudo apt-get install cmake
5050
sudo apt-get install ccache # optional
@@ -61,16 +61,21 @@ support for Visual Studio 2015.
6161

6262
An easy way to get development tools is via [Chocolatey](https://chocolatey.org/).
6363

64-
Unfortunately, the `cmake.install` package is semi-broken, so use the portable
65-
version.
64+
```cmd
65+
choco install git
66+
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
67+
choco install ninja
6668
67-
```
68-
choco install cmake.portable
69-
choco install ninja # optional
69+
# Build scripts use bash and python
70+
choco install msys2
7071
72+
# Required for building gRPC and its dependencies
7173
choco install activeperl
7274
choco install golang
7375
choco install nasm
76+
77+
# Optional: can speed up builds
78+
choco install openssl
7479
```
7580

7681
## Building
@@ -92,7 +97,7 @@ The basic shape of the build is to:
9297

9398
On most systems that looks like this:
9499

95-
```
100+
```bash
96101
mkdir build
97102
cd build
98103
cmake ..
@@ -125,9 +130,17 @@ Firebase-specific goodies:
125130

126131
For example:
127132

128-
```
129-
mkdir build
133+
On Mac or Linux:
134+
```bash
135+
cmake -H. -Bbuild -G Ninja -DFIREBASE_DOWNLOAD_DIR:PATH=$HOME/.downloads
130136
cd build
131-
cmake -G Ninja -DFIREBASE_DOWNLOAD_DIR:PATH=.downloads ..
132137
ninja && ninja test
133138
```
139+
140+
On Windows:
141+
```cmd
142+
mkdir %USERPROFILE%\AppData\LocalLow\CMake
143+
cmake -H. -Bbuild -G Ninja ^
144+
-DFIREBASE_DOWNLOAD_DIR:PATH=%USERPROFILE%\AppData\LocalLow\CMake ^
145+
-DOPENSSL_ROOT_DIR:Path="c:\Program Files\OpenSSL-Win64"
146+
```

0 commit comments

Comments
 (0)