Skip to content

Commit

Permalink
doc: update instructions for macOS (#7668)
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan authored Nov 25, 2021
1 parent cdfa770 commit 8d5c432
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions doc/contributor/howto-guide-setup-development-workstation.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,31 +304,28 @@ git clone [email protected]:<GITHUB-USERNAME_HERE>/google-cloud-cpp.git
cd google-cloud-cpp
```

### Running the CI scripts
### Manual builds with CMake

The CI scripts follow a similar pattern to the scripts for Linux and Windows:
The [guide](/doc/contributor/howto-guide-setup-cmake-environment.md) generally
works for macOS too. We recommend using `Ninja` and `vcpkg` for development.
When using `vcpkg` you should disable the OpenSSL checks:

```shell
./ci/kokoro/macos/build.sh bazel # <-- Run the `bazel` CI build
./ci/kokoro/macos/build.sh cmake-vcpkg # <-- Build with CMake
git clone -C $HOME https://github.com/microsoft/vcpkg.git
env VCPKG_ROOT=$HOME/vcpkg $HOME/vcpkg/bootstrap-vcpkg.sh
cmake -GNinja -S. -Bcmake-out/ \
-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF
cmake --build cmake-out
```

### Manual builds with CMake
### Running the CI scripts

The [guide](/doc/contributor/howto-guide-setup-cmake-environment.md) generally
works for macOS too. The only difference is the configuration for OpenSSL. The
native OpenSSL library on macOS does not work, but the one distributed by
`homebrew` does. You **must** set the `OPENSSL_ROOT_DIR` environment variable
before configuring CMake, so CMake can use this alternative version. You cannot
just pass this as a `-D` option to CMake, because the value must recurse to all
the external projects. There is an example of this in the
[vcpkg build script](/ci/kokoro/macos/builds/cmake-vcpkg.sh).
The CI scripts follow a similar pattern to the scripts for Linux and Windows:

```shell
git clone -C $HOME https://github.com/microsoft/vcpkg.git
env VCPKG_ROOT=$HOME/vcpkg $HOME/vcpkg/bootstrap-vcpkg.sh
cmake -H. -Bcmake-out/ -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build cmake-out -- -j $(nproc)
./ci/kokoro/macos/build.sh bazel # <-- Run the `bazel` CI build
./ci/kokoro/macos/build.sh cmake-vcpkg # <-- Build with CMake
```

## Appendix: Linux VM on Google Compute Engine
Expand Down

0 comments on commit 8d5c432

Please sign in to comment.