-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: update instructions for macOS (#7668)
- Loading branch information
Showing
1 changed file
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|