8000 Adopt protobuf's .bazelrc to simplify cross-compilation · tronweb3/protobuf-javascript@c4fbfe3 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit c4fbfe3

Browse files
committed
Adopt protobuf's .bazelrc to simplify cross-compilation
1 parent 8afb6eb commit c4fbfe3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.bazelrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
2+
3+
build:dbg --compilation_mode=dbg
4+
5+
build:opt --compilation_mode=opt
6+
7+
build:san-common --config=dbg --strip=never --copt=-O0 --copt=-fno-omit-frame-pointer
8+
9+
build:asan --config=san-common --copt=-fsanitize=address --linkopt=-fsanitize=address
10+
# ASAN hits ODR violations with shared linkage due to rules_proto.
11+
build:asan --dynamic_mode=off
12+
13+
build:msan --config=san-common --copt=-fsanitize=memory --linkopt=-fsanitize=memory
14+
build:msan --copt=-fsanitize-memory-track-origins
15+
build:msan --copt=-fsanitize-memory-use-after-dtor
16+
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1
17+
18+
build:tsan --config=san-common --copt=-fsanitize=thread --linkopt=-fsanitize=thread
19+
20+
build:ubsan --config=san-common --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined
21+
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
22+
# Workaround for the fact that Bazel links with $CC, not $CXX
23+
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
24+
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
25+
26+
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
27+
# https://github.com/protocolbuffers/protobuf/issues/14313
28+
common --noenable_bzlmod
29+
30+
# Important: this flag ensures that we remain compliant with the C++ layering
31+
# check.
32+
build --features=layering_check
33+
34+
common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1

0 commit comments

Comments
 (0)
0