-
Notifications
You must be signed in to change notification settings - Fork 215
/
.bazelrc
54 lines (43 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
# bazel < 7 needs explicit enabling of bzlmod dependencies.
build --enable_bzlmod
# Enable support for absl types like string_view in gtest.
build --define="absl=1"
build --enable_platform_specific_config
# Gather build version information
build:linux --workspace_status_command="bazel/build-version.py"
build:freebsd --workspace_status_command="bazel/build-version.py"
build:openbsd --workspace_status_command="bazel/build-version.py"
build:macos --workspace_status_command="bazel/build-version.py"
build:windows --workspace_status_command="python bazel/build-version.py"
# Systems with gcc or clang
common:linux --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17
common:freebsd --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17 --linkopt=-lm --host_linkopt=-lm
common:openbsd --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17 --linkopt=-lm --host_linkopt=-lm
common:macos --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17
# https://github.com/abseil/abseil-cpp/issues/848
# https://github.com/bazelbuild/bazel/issues/4341#issuecomment-758361769
common:macos --features=-supports_dynamic_linker --linkopt=-framework --linkopt=CoreFoundation --host_linkopt=-framework --host_linkopt=CoreFoundation
# Force the use clang-cl on Windows instead of MSVC. MSVC has some issues with
# the codebase, so we focus the effort for now is to have a Windows Verible
# compiled with clang-cl before fixing the issues unique to MSVC.
# Since we use designated initializers (C99 ... but >= c++20), compiler really wants the c++20 mode
common:windows --compiler=clang-cl --cxxopt=/std:c++20 --host_cxxopt=/std:c++20 --client_env=BAZEL_CXXOPTS=/std:c++20
build --cxxopt="-Wno-unknown-warning-option" --host_cxxopt="-Wno-unknown-warning-option"
# TODO: this looks like benign where it happens but to be explored further
build --cxxopt="-Wno-dangling-reference" --host_cxxopt="-Wno-dangling-reference"
# Newer bisons create an unused label.
build --cxxopt="-Wno-unused-label" --host_cxxopt="-Wno-unused-label"
# 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
# Address sanitizer settings.
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
build:create_static_linked_executables --linkopt=-fuse-ld=bfd --features=-supports_start_end_lib --//bazel:create_static_linked_executables
try-import %workspace%/user.bazelrc