forked from dds-bridge/dds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bazelrc
More file actions
62 lines (54 loc) · 2.85 KB
/
Copy path.bazelrc
File metadata and controls
62 lines (54 loc) · 2.85 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
52
53
54
55
56
57
58
59
60
61
62
# Bazel configuration for DDS project
# Skip Playwright browser tests on `bazel test //...` (network, Chromium, no-sandbox).
# Run e2e explicitly: bazel test --test_tag_filters=e2e //web:web_e2e_tests
# Run every test: bazel test --test_tag_filters= /...
test --test_tag_filters=-e2e
common --enable_platform_specific_config
# Platform-specific C++ standard flags
build:macos --cxxopt=-std=c++20
build:macos --host_cxxopt=-std=c++20
build:linux --cxxopt=-std=c++20
build:linux --host_cxxopt=-std=c++20
# Keep Windows C++ standard selection in CPPVARIABLES.bzl selects.
# Avoid global /std flags here so wasm transitions on Windows don't inherit MSVC opts.
# Performance optimization flags
build:opt --compilation_mode=opt
# AddressSanitizer configuration
# Usage: bazel test --config=asan //path:target
# macOS uses the Xcode toolchain (build:asan_macos). See docs/BUILD_SYSTEM.md
# ("AddressSanitizer and ThreadSanitizer (macOS)") for clang/Xcode version coupling.
build:asan --config=asan_macos
build:asan --copt=-fsanitize=address
build:asan --linkopt=-fsanitize=address
# Undefine _FORTIFY_SOURCE; it conflicts with ASAN instrumentation.
build:asan --copt=-U_FORTIFY_SOURCE
build:asan --strip=never
build:asan --features=dbg
build:asan --compilation_mode=dbg
test:asan --test_timeout=120,300,900,3600
# GoogleTest headers can trigger conversion warnings on Clang; suppress them.
# Scoped to `build` (not `test`) so the suppression also applies to plain
# `bazel build` of test targets and tooling that compiles GoogleTest, not just
# `bazel test`. The `build` config is inherited by `test`, `run`, etc.
# On Linux, use -Wno-conversion for portability when the system compiler is GCC.
build:macos --cxxopt=-Wno-character-conversion
build:linux --cxxopt=-Wno-conversion
# macOS AddressSanitizer must use the Xcode compiler/runtime. LLVM-instrumented
# binaries hang with LLVM's ASAN dylib and abort with Xcode's (version mismatch).
# Chained from build:asan; Apple toolchains do not match on Linux and are ignored.
build:asan_macos --extra_toolchains=@local_config_apple_cc_toolchains//:all
build:asan_macos --copt=-Wno-macro-redefined
# ThreadSanitizer configuration
# Usage: bazel test --config=tsan //path:target
# macOS loads Xcode's compiler-rt via build:tsan_macos (rpath uses clang/N).
# Keep N aligned with MODULE.bazel llvm_versions and installed Xcode; see
# docs/BUILD_SYSTEM.md ("AddressSanitizer and ThreadSanitizer (macOS)").
build:tsan --config=tsan_macos
build:tsan --copt=-fsanitize=thread
build:tsan --linkopt=-fsanitize=thread
build:tsan --strip=never
build:tsan --features=dbg
build:tsan --compilation_mode=dbg
test:tsan --test_timeout=120,300,900,3600
# Hardcoded rpath: .../lib/clang/21/... must match MODULE.bazel llvm major and Xcode.
build:tsan_macos --linkopt=-Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin