-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.bazelrc
More file actions
51 lines (42 loc) · 1.96 KB
/
.bazelrc
File metadata and controls
51 lines (42 loc) · 1.96 KB
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
common --noenable_bzlmod
build --incompatible_enable_cc_toolchain_resolution
build --features=c++20
build --features=-c++17
build --compiler=compiler
build --nostart_end_lib
build --strip never
test --test_output=errors
build:host --platforms=@local_config_platform//:host
build:host --linkopt=-lrt
# bazel_deps select()s on this to pick compiler-specific copts (e.g.
# libxcb's -Wno-* warnings). The host build uses the bundled
# llvm_toolchain, so declare CLANG. Target builds use a different
# toolchain and don't go through these select()s.
build:host --define CLANG=true
test:host --define CLANG=true
build:host --copt=-Werror
build:host --copt=-Wno-parentheses-equality
# Catch the `return X(); if (...) ...` family at compile time. clang
# only -- gcc's -Wunreachable-code has been a no-op since 4.4.
build:host --copt=-Wunreachable-code
# UBSan build, layered on top of host. vptr and function checks are
# disabled because the vendored llvm_toolchain ships only libc++'s
# inline namespace and no libc++abi, so the typeinfo machinery those
# checks rely on does not link. alignment is disabled because snappy
# intentionally performs unaligned loads on x86; mjlib's own
# unaligned access has been replaced with memcpy.
build:host_ubsan --config=host
build:host_ubsan --copt=-fsanitize=undefined
build:host_ubsan --copt=-fno-sanitize=vptr,function,alignment
build:host_ubsan --linkopt=-fsanitize=undefined
build:host_ubsan --linkopt=-fno-sanitize=vptr,function,alignment
test:host_ubsan --test_env=UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
build:target --platforms=@com_github_mjbots_rules_mbed//:stm32g4
build:target --copt=-Werror
build:target --copt=-Wdouble-promotion
# The following are used to work around
# https://github.com/bazelbuild/bazel/issues/12036 as there is
# otherwise no way to get the bazel-out directory to be different
# across platforms.
build:target --crosstool_top=@com_github_mjbots_rules_mbed//tools/cc_toolchain:toolchain
build:target --cpu=stm32g4