-
Notifications
You must be signed in to change notification settings - Fork 11
/
.bazelrc
82 lines (70 loc) · 2.82 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
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
build --incompatible_enable_cc_toolchain_resolution
build --features=external_include_paths
build --copt -g
build --strip=never
build --cxxopt='-fPIC'
build --host_cxxopt='-fPIC'
# We support C++20
build --host_cxxopt='-std=c++20'
build --cxxopt='-std=c++20'
# Warnings and options
build --cxxopt='-Wall'
build --cxxopt='-Wdeprecated'
build --cxxopt='-Wcomment'
build --cxxopt='-Wimplicit-fallthrough'
build --cxxopt='-Wnarrowing'
build --cxxopt='-Wnull-dereference'
build --cxxopt='-Wregister'
build --cxxopt='-Wshift-count-negative'
build --cxxopt='-Wshift-count-overflow'
build --cxxopt='-Wint-to-pointer-cast'
build --cxxopt='-Wodr'
build:clang --cxxopt='-Wshadow-all'
build:clang --cxxopt='-Wcall-to-pure-virtual-from-ctor-dtor'
build:clang --cxxopt='-Wcomma'
build:clang --cxxopt='-Wdangling'
build:clang --cxxopt='-Winteger-overflow'
build:clang --cxxopt='-Winvalid-noreturn'
build:clang --cxxopt='-Wnull-arithmetic'
build:clang --cxxopt='-Wnull-conversion'
build:clang --cxxopt='-Wunsequenced'
build:clang --cxxopt='-Wunreachable-code-aggressive'
build:clang --cxxopt='-Wvoid-pointer-to-int-cast'
build:clang --cxxopt='-Wwritable-strings'
build:clang --cxxopt='-Wmismatched-parameter-types'
build:clang --cxxopt='-Wmismatched-return-types'
build:clang --cxxopt='-fno-trigraphs'
build:clang --cxxopt='-fno-digraphs'
build:clang --cxxopt='-ffp-model=strict'
# Warnings only enabled through clang-tidy clang-diagnostic-.. since external libs produce them.
#build --cxxopt='-Wconversion'
#build --cxxopt='-Wfloat-equal'
build:clang --cxxopt='-Wno-deprecated-copy-with-user-provided-dtor'
build:clang --cxxopt='-Wno-deprecated-copy-with-dtor'
build:clang --cxxopt='-Wno-deprecated-dynamic-exception-spec'
build:clang --cxxopt='-Wno-implicit-int-conversion'
build:clang --cxxopt='-Wno-implicit-int-float-conversion'
build:clang --cxxopt='-Wno-float-conversion'
build:clang --cxxopt='-Wno-implicit-float-conversion'
build:clang --cxxopt='-Wno-shorten-64-to-32'
build:clang --cxxopt='-Wno-comma'
build:clang --cxxopt='-Wno-unreachable-code-break'
build:clang --cxxopt='-Wno-unreachable-code-return'
build:clang --cxxopt='-Wno-shadow-uncaptured-local'
# Specifically disabled warnings, overly pedantic.
build --cxxopt='-Wno-sign-compare'
build --cxxopt='-Wno-sign-conversion'
# Common flags for Clang
build:clang --action_env=BAZEL_COMPILER=clang
build:clang --action_env=CC=clang --action_env=CXX=clang++
build:clang --linkopt=-fuse-ld=lld
# Clang with libc++
build:libc++ --config=clang
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=-l%:libc++.a:-l%:libc++abi.a
build:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread
build:libc++ --define force_libcpp=enabled