forked from googleapis/google-cloud-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
121 lines (108 loc) · 4.6 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: This file is not loaded if google-cloud-cpp is built as part of a
# larger project.
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true
# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which
# disables C++14 features, even if the compilers defaults to C++ >= 14
build:linux --cxxopt=-std=c++14
build:macos --cxxopt=-std=c++14
# Protobuf and gRPC require (or soon will require) C++14 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++14
build:macos --host_cxxopt=-std=c++14
# Do not create the convenience links. They are inconvenient when the build
# runs inside a docker image or if one builds a quickstart and then builds
# the project separately.
build --experimental_convenience_symlinks=ignore
# Inject ${GTEST_SHUFFLE} and ${GTEST_RANDOM_SEED} into the test environment
# if they are set in the enclosing environment. This allows for running tests
# in a random order to help expose undesirable interdependencies.
test --test_env=GTEST_SHUFFLE --test_env=GTEST_RANDOM_SEED
# By default, build the library with OpenTelemetry
build --@io_opentelemetry_cpp//api:with_abseil
build --//:experimental-opentelemetry
# Clang Sanitizers, use with (for example):
#
# --client_env=CXX=clang++ --client_env=CC=clang --config asan
#
# --config asan: Address Sanitizer
build:asan --strip=never
build:asan --copt=-Og
build:asan --copt=-g
build:asan --copt=-fsanitize=address
build:asan --copt=-fno-omit-frame-pointer
build:asan --linkopt=-fsanitize=address
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
build:asan --action_env=LSAN_OPTIONS=report_objects=1
# --config tsan: Thread Sanitizer
build:tsan --strip=never
build:tsan --copt=-Og
build:tsan --copt=-g
build:tsan --copt=-fsanitize=thread
build:tsan --copt=-fno-omit-frame-pointer
build:tsan --linkopt=-fsanitize=thread
# report_atomic_races=0: https://github.com/google/sanitizers/issues/953
build:tsan --action_env=TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1:report_atomic_races=0
# --config ubsan: Undefined Behavior Sanitizer
build:ubsan --strip=never
build:ubsan --copt=-Og
build:ubsan --copt=-g
build:ubsan --copt=-fsanitize=undefined
build:ubsan --copt=-fno-omit-frame-pointer
build:ubsan --linkopt=-fsanitize=undefined
build:ubsan --linkopt=-fsanitize-link-c++-runtime
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
build:ubsan --cxxopt=-stdlib=libc++
build:ubsan --linkopt=-stdlib=libc++
build:ubsan --linkopt=-lc++
build:ubsan --linkopt=-lc++abi
# --config xsan: Runs misc. sanitizers that aren't covered elsewhere.
build:xsan --strip=never
build:xsan --copt=-Og
build:xsan --copt=-g
build:xsan --copt=-fsanitize=float-divide-by-zero
build:xsan --copt=-fsanitize=nullability
build:xsan --copt=-fno-omit-frame-pointer
build:xsan --cxxopt=-stdlib=libc++
build:xsan --linkopt=-stdlib=libc++
build:xsan --linkopt=-lc++
build:xsan --linkopt=-lc++abi
build:xsan --linkopt=-fsanitize-link-c++-runtime
build:xsan --linkopt=-fsanitize=float-divide-by-zero
build:xsan --linkopt=-fsanitize=nullability
build:xsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
# --config msan: Memory Sanitizer
build:msan --strip=never
build:msan --copt=-Og
build:msan --copt=-g
build:msan --copt=-fsanitize=memory
build:msan --copt=-fno-omit-frame-pointer
build:msan --copt=-fsanitize-memory-track-origins
build:msan --copt=-fsanitize-memory-use-after-dtor
build:msan --cxxopt=-I/usr/include/x86_64-unknown-linux-gnu/c++/v1
build:msan --linkopt=-fsanitize=memory
build:msan --action_env=LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1
build:msan --cxxopt=-stdlib=libc++
build:msan --linkopt=-stdlib=libc++
build:msan --linkopt=-L/usr/lib/x86_64-unknown-linux-gnu
build:msan --linkopt=-lc++
build:msan --linkopt=-lc++abi
# --config libcxx: Compile and link using libc++.
build:libcxx --cxxopt=-stdlib=libc++
build:libcxx --linkopt=-stdlib=libc++
build:libcxx --linkopt=-lc++
build:libcxx --linkopt=-lc++abi