Skip to content

Commit cc0004e

Browse files
authored
chore: update windows development instructions (#3295)
1 parent 258e2d2 commit cc0004e

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

doc/setup-development-environment.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ in a `cmd.exe` shell, running as the `Administrator`:
121121

122122
Then you can install the dependencies in the same shell:
123123
```console
124-
> choco install -y cmake git cmake.portable activeperl ninja golang yasm putty
124+
> choco install -y cmake git cmake.portable activeperl ninja golang yasm putty msys2 bazel
125125
> choco install -y visualstudio2017community visualstudio2017-workload-nativedesktop microsoft-build-tools
126126
```
127127

@@ -160,6 +160,19 @@ and do not forget to setup the `GIT_SSH` environment variable:
160160
> set GIT_SSH=plink
161161
```
162162

163+
### Clone `google-cloud-cpp`
164+
165+
You may need to create a new key pair to connect to GitHub. Search the web
166+
for how to do this. Then you can clone the code:
167+
168+
```console
169+
> cd \Users\%USERNAME%
170+
> git clone [email protected]:<GITHUB-USERNAME_HERE>/google-cloud-cpp.git
171+
> cd google-cloud-cpp
172+
```
173+
174+
### Compile `google-cloud-cpp` using cmake and vcpkg
175+
163176
### Download and compile `vcpkg`
164177

165178
The previous installation should create a
@@ -180,23 +193,14 @@ installing `google-cloud-cpp` itself:
180193

181194
```console
182195
> vcpkg.exe install google-cloud-cpp:x64-windows-static
196+
> vcpkg.exe install --recurse google-cloud-cpp-common[test]:x64-windows-static
183197
> vcpkg.exe integrate install
184198
```
185199

186-
### Clone and compile `google-cloud-cpp`
187-
188-
You may need to create a new key pair to connect to GitHub. Search the web
189-
for how to do this. Then you can clone the code:
190-
191-
```console
192-
> cd \Users\%USERNAME%
193-
> git clone [email protected]:<GITHUB-USERNAME_HERE>/google-cloud-cpp.git
194-
> cd google-cloud-cpp
195-
```
196-
197-
And compile the code using:
200+
Compile the code using:
198201

199202
```console
203+
> cd \Users\%USERNAME%\google-cloud-cpp
200204
> call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
201205
> cmake -GNinja -H. -Bcmake-out
202206
-DCMAKE_BUILD_TYPE=Debug
@@ -212,6 +216,24 @@ Run the tests using:
212216
> ctest --output-on-failure
213217
```
214218

219+
### Compile `google-cloud-cpp` using bazel
220+
221+
Due to Windows command line length limits, create an abbreviated output directory:
222+
```console
223+
mkdir c:\b
224+
```
225+
226+
Compile the code:
227+
```console
228+
cd \Users\%USERNAME%\google-cloud-cpp
229+
bazel --output_user_root="c:\b" build //google/cloud/...:all
230+
```
231+
232+
Run all the tests:
233+
```console
234+
bazel --output_user_root="c:\b" test //google/cloud/...:all
235+
```
236+
215237
## Appendix: Creating a Linux VM using Google Compute Engine
216238

217239
From time to time you may want to setup a Linux VM in Google Compute Engine.

0 commit comments

Comments
 (0)