forked from ApolloAuto/apollo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbazel.rc
122 lines (100 loc) · 4.38 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
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
122
# Apollo Bazel configuration file.
# This file tries to group and simplify build options for Apollo
# +------------------------------------------------------------+
# | Startup Options |
# +------------------------------------------------------------+
startup --batch_cpu_scheduling
startup --host_jvm_args="-XX:-UseParallelGC"
fetch --experimental_multi_threaded_digest=true
query --experimental_multi_threaded_digest=true
# +------------------------------------------------------------+
# | Common Options |
# +------------------------------------------------------------+
# Force bazel output to use colors (good for jenkins) and print useful errors.
common --color=yes
# +------------------------------------------------------------+
# | Build Configurations |
# +------------------------------------------------------------+
# Make Bazel print out all options from rc files.
# build --announce_rc
build --show_timestamps
# Work around the sandbox issue.
build --spawn_strategy=standalone
# Enable colorful output of GCC
build --cxxopt="-fdiagnostics-color=always"
# Do not show warnings from external dependencies.
# build --output_filter="^//"
build --per_file_copt=external/upb/.*@-Wno-sign-compare
build --copt="-Werror=sign-compare"
build --copt="-Werror=return-type"
build --copt="-Werror=unused-variable"
build --copt="-Werror=unused-but-set-variable"
build --copt="-Werror=switch"
build --cxxopt="-Werror=reorder"
# Default paths for SYSTEM LIBRARIES
build --define=PREFIX=/usr
build --define=LIBDIR=$(PREFIX)/lib
build --define=INCLUDEDIR=$(PREFIX)/include
build --define=use_fast_cpp_protos=true
# dbg config, as a shorthand for '--config=optimize -c dbg'
build:dbg -c dbg
build:opt -c opt
build --config=optimize
# Instruction set optimizations
build:optimize --copt=-march=native
build:optimize --host_copt=-march=native
# Now "cpu" configuration was dummy
build:cpu --verbose_failures
build:gpu --define USE_GPU=true
build:gpu --cxxopt="-DUSE_GPU=1"
# Build with profiling
build:prof --linkopt=-lprofiler
build:prof --cxxopt="-DENABLE_PERF=1"
# Build Apollo with C++ 17 features.
build:c++17 --cxxopt=-std=c++1z
# build:c++17 --cxxopt=-stdlib=libc++
build:c++1z --config=c++17
# Enable C++14 (aka c++1y) by default
build --cxxopt="-std=c++14"
build --host_cxxopt="-std=c++14"
# +------------------------------------------------------------+
# | Test Configurations |
# +------------------------------------------------------------+
test --flaky_test_attempts=3
test --test_size_filters=small,medium
# test --test_env=LD_LIBRARY_PATH
# test --test_env=PYTHONPATH
# By default prints output only from failed tests.
test --test_output=errors
test:unit_test --test_verbose_timeout_warnings
coverage --javabase="@bazel_tools//tools/jdk:remote_jdk11"
# coverage --host_javabase="@bazel_tools//tools/jdk:remote_jdk11"
coverage --instrument_test_targets
coverage --combined_report=lcov
coverage --nocache_test_results
# coverage --coverage_report_generator="@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main"
coverage --cxxopt=--coverage
coverage --cxxopt=-fprofile-arcs
coverage --cxxopt=-ftest-coverage
coverage --linkopt=-lgcov
# +------------------------------------------------------------+
# | 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
test:cpplint --flaky_test_attempts=1
# Regular unit tests.
test:unit_test --test_tag_filters=-cpplint
# Coverage tests
coverage --test_tag_filters=-cpplint
# +------------------------------------------------------------+
# | Python Configurations |
# +------------------------------------------------------------+
# Python support was configured by third_party/py .