Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 16201cc

Browse files
authored
docs: document additional flags needed for macOS (#1005)
gRPC requires an additional flag to compile with Bazel. I chose to both document this *and* set it on our .bazelrc. Note that users will need to set this flag on their own .bazelrc.
1 parent c35a64a commit 16201cc

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# To workaround a bug in Bazel [1], gRPC requires this flag on macOS builds,
16+
# and there is (AFAIK) no way to "inherit" their definitions.
17+
# [1]: https://github.com/bazelbuild/bazel/issues/4341
18+
build --copt=-DGRPC_BAZEL_BUILD
19+
1520
# Clang Sanitizers, use with (for example):
1621
#
1722
# --client_env=CXX=clang++ --client_env=CC=clang --config asan

INSTALL.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ cc_binary(
108108
)
109109
```
110110

111+
### Building with Bazel on macOS
112+
113+
To workaround a bug in Bazel ([bazelbuild/bazel#4341][bazel-bug-4341-link]) gRPC needs a
114+
command-line flag when compiled using Bazel on macOS:
115+
116+
[bazel-bug-4341]: https://github.com/bazelbuild/bazel/issues/4341
117+
118+
```bash
119+
bazel build --copt=-DGRPC_BAZEL_BUILD ...
120+
```
121+
122+
Consider adding this option to your project's `.bazelrc` file.
123+
111124
## Required Libraries
112125

113126
`google-cloud-cpp` directly depends on the following libraries:

ci/test-readme/generate-install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ cc_binary(
128128
)
129129
```
130130
131+
### Building with Bazel on macOS
132+
133+
To workaround a bug in Bazel ([bazelbuild/bazel#4341][bazel-bug-4341-link]) gRPC needs a
134+
command-line flag when compiled using Bazel on macOS:
135+
136+
[bazel-bug-4341]: https://github.com/bazelbuild/bazel/issues/4341
137+
138+
```bash
139+
bazel build --copt=-DGRPC_BAZEL_BUILD ...
140+
```
141+
142+
Consider adding this option to your project's `.bazelrc` file.
143+
131144
## Required Libraries
132145
133146
`google-cloud-cpp` directly depends on the following libraries:

0 commit comments

Comments
 (0)