-
Notifications
You must be signed in to change notification settings - Fork 182
/
.bazelrc
75 lines (60 loc) · 3.09 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
# We use bazel >= 6, but no bzlmod yet.
common --noenable_bzlmod
# Disable rules_python Starlark rules for Bazel 7+.
# See https://github.com/bazelbuild/rules_python/issues/1069#issuecomment-1942053014.
build --action_env=RULES_PYTHON_ENABLE_PYSTAR=0
# Minimium c++ standard used.
build --cxxopt "-std=c++20" --host_cxxopt "-std=c++20"
build --action_env=BAZEL_CXXOPTS=-std=c++20
# Depending on the installation, clang or clang-tidy need to be told that
# a c++ file is, indeed, containing c++ (bazel just invokes clang, not clang++)
build --cxxopt "-xc++" --host_cxxopt "-xc++"
# Enable default C++ extensions (required in switching to our packaged LLVM)
build --copt "-D_DEFAULT_SOURCE=1" --host_copt "-D_DEFAULT_SOURCE=1"
# Tell that auto_ptr<> is not available. Needed for boost (still needed ?)
build --copt "-D_HAS_AUTO_PTR_ETC=0" --host_copt "-D_HAS_AUTO_PTR_ETC=0"
# Turn warnings on...
build --copt "-Wall" --host_copt "-Wall"
build --copt "-Wextra" --host_copt "-Wextra"
# Turn some specific warnings into errors.
build --copt "-Werror=switch" --host_copt "-Werror=switch"
# ... and disable the warnings we're not interested in.
build --copt "-Wno-sign-compare" --host_copt "-Wno-sign-compare"
build --copt "-Wno-comment" --host_copt "-Wno-comment"
build --copt "-Wno-unused-parameter" --host_copt "-Wno-unused-parameter"
build --copt "-Wno-unknown-pragmas" --host_copt "-Wno-unknown-pragmas"
build --copt "-Wno-missing-field-initializers" --host_copt "-Wno-missing-field-initializers"
build --copt "-Wno-bitwise-instead-of-logical" --host_copt "-Wno-bitwise-instead-of-logical"
# For 3rd party code: Disable warnings entirely.
# They are not actionable and just create noise.
build --per_file_copt=external/.*@-w
build --host_per_file_copt=external/.*@-w
# These warnings show up in 3rd party code headers that are included by
# our targets and thus are reported even with -w. Explicitly disable.
# Protobuf.
build --copt "-Wno-deprecated-declarations" --host_copt "-Wno-deprecated-declarations"
# Use absl in googletest to work around
# https://github.com/google/googletest/issues/4383
build --define absl=1
build --incompatible_enable_cc_toolchain_resolution
build --@llvm_zstd//:llvm_enable_zstd=false
# Do not use some deps from or-tools
build --@com_google_ortools//ortools/algorithms:with_scip=false
build --@com_google_ortools//ortools/linear_solver:with_glpk=false
build --@com_google_ortools//ortools/linear_solver:with_pdlp=false
build --@com_google_ortools//ortools/linear_solver:with_scip=false
# Settings for --config=asan address sanitizer build
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -O1
build:asan --copt -g
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address
# To regenerate this file (if needed), please run:
#
# bazel run @com_google_fuzztest//bazel:setup_configs > fuzztest.bazelrc
#
try-import %workspace%/fuzztest.bazelrc
# https://bazel.build/configure/best-practices#bazelrc-file
try-import %workspace%/user.bazelrc