-
Notifications
You must be signed in to change notification settings - Fork 5
/
.bazelrc
48 lines (40 loc) · 1.87 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
build --enable_platform_specific_config
# Build with C++17 and clang, enable absl for gtest to have stack traces.
build --cxxopt=-std=c++17 --define absl=1
# For coverage builds, don't include tests tagged with "nocoverage"
coverage --config=coverage --test_tag_filters=-nocoverage --build_tag_filters=-nocoverage
build:coverage --instrument_test_targets
build:coverage --cxxopt=-DNDEBUG
test:coverage --collect_code_coverage
test:coverage --nocache_test_results
coverage --combined_report=lcov
coverage --instrumentation_filter="^//:"
# Optionally build with C++20.
build:cpp20 --cxxopt=-std=c++20
# Fixes symbols when debugging on mac.
build:macos --features=oso_prefix_is_pwd
# Flags for libc++
build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
build:libc++ --action_env=LDFLAGS=-stdlib=libc++
build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++
build:libc++ --action_env=BAZEL_LINKLIBS=-lc++abi:-lc++
build:libc++ --define force_libcpp=enabled
# Common flags for Clang
build:clang --action_env=CC=clang
build:clang --action_env=CXX=clang++
build:clang --action_env=BAZEL_COMPILER=clang
build:clang --config=libc++
# Basic ASAN/UBSAN that works for gcc
build:asan --linkopt -ldl
build:asan --copt -fsanitize=address,undefined
build:asan --linkopt -fsanitize=address,undefined
build:asan --test_env=ASAN_SYMBOLIZER_PATH
# These require libubsan, which is not linked properly by bazel, so disable.
# See https://github.com/google/oss-fuzz/issues/713
build:asan --copt -fno-sanitize=vptr,function
build:asan --linkopt -fno-sanitize=vptr,function
# Define the --config=asan-libfuzzer configuration.
build:asan-libfuzzer --config=clang --config=cpp20
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan