forked from ApolloAuto/apollo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbazel.rc
87 lines (68 loc) · 3.07 KB
/
bazel.rc
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
# bazelrc file
# https://docs.bazel.build/versions/master/user-manual.html
# bazel >= 0.18 looks for %workspace%/.bazelrc (which redirects here)
# Older bazel versions look for %workspace%/tools/bazel.rc (this file)
# See https://github.com/bazelbuild/bazel/issues/6319
# +------------------------------------------------------------+
# | Startup Options |
# +------------------------------------------------------------+
startup --batch_cpu_scheduling
startup --host_jvm_args=-XX:-UseParallelGC
# +------------------------------------------------------------+
# | Test Configurations |
# +------------------------------------------------------------+
# By default prints output only from failed tests.
test --test_output=errors
# Work around the sandbox issue.
test --spawn_strategy=standalone
# Specify protobuf cc toolchain
test --proto_toolchain_for_cc="@com_google_protobuf//:cc_toolchain"
# +------------------------------------------------------------+
# | CPP Lint Tests & Unit Tests |
# +------------------------------------------------------------+
# By default, cpplint tests are run as part of `bazel test` alongside all of
# the other compilation and test targets. This is a convenience shortcut to
# only do the cpplint testing and nothing else.
# Do bazel test --config=cpplint <target> to enable this configuration.
# To enable the lint test, the BUILD *must* load the cpplint.bzl by having
# 'load("//tools:cpplint.bzl", "cpplint")' at the beginning and 'cpplint()'
# at the end.
test:cpplint --test_tag_filters=cpplint
test:cpplint --build_tests_only
# Regular unit tests.
test:unit_test --test_tag_filters=-cpplint
# Coverage tests
test:coverage --test_tag_filters=-cpplint
test:coverage --copt=--coverage
test:coverage --cxxopt=--coverage
test:coverage --cxxopt=-fprofile-arcs
test:coverage --cxxopt=-ftest-coverage
test:coverage --linkopt=-coverage
test:coverage --linkopt=-lgcov
test:coverage --linkopt=-lgcc
test:coverage --linkopt=-lc
# +------------------------------------------------------------+
# | Build Configurations |
# +------------------------------------------------------------+
# Do not show warnings from external dependencies.
build --output_filter="^//"
build --show_timestamps
# Work around the sandbox issue.
build --spawn_strategy=standalone
# Specify protobuf cc toolchain
build --proto_toolchain_for_cc="@com_google_protobuf//:cc_toolchain"
# build with profiling
build:cpu_prof --linkopt=-lprofiler
build --copt="-Werror=sign-compare"
build --copt="-Werror=return-type"
build --copt="-Werror=reorder"
build --copt="-Werror=unused-variable"
build --copt="-Werror=unused-but-set-variable"
build --copt="-Werror=switch"
# Strict check on type conversion.
# absl/strings/str_cat.h breaks the rule.
# build --per_file_copt=^modules/.*\.cc,-modules/tools/visualizer/.*\.cc,^cyber/.*\.cc@-Werror=conversion
# Enable C++14
build --cxxopt="-std=c++1y"
# Enable colorful output of GCC
# build --cxxopt="-fdiagnostics-color=always"