-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.bazelrc
More file actions
70 lines (61 loc) · 2.49 KB
/
.bazelrc
File metadata and controls
70 lines (61 loc) · 2.49 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
63
64
65
66
67
68
69
70
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
# Build settings
build --compiler=g++ # Specify the compiler if needed, e.g., gcc, clang
build --cxxopt=-std=c++23 # Use C++23 standard (adjust if needed)
build --cxxopt=-DCL_TARGET_OPENCL_VERSION=300
build --per_file_copt=.*,-tests/*.cpp@-Werror,-Wall,-Wextra,-Wpedantic,-Wno-deprecated-declarations
build --per_file_copt=kernels/nnef/NNEF-Tools/.*@-Wno-error
build --per_file_copt=external/.*@-Wno-error
build --experimental_ui_max_stdouterr_bytes=-1
# Test settings
test --test_output=errors # Show errors from tests
# test --test_env=PATH=/usr/local/bin:/usr/bin:/bin # Example of setting environment variables for tests
# General settings
build --jobs=4 # Use 4 parallel jobs for builds
build --color=yes # Enable colored output in build logs
build --show_progress=true # Show build progress in the terminal
# build --keep_going # Continue building even if some targets fail
# Default x86 configuration
build --platforms=@platforms//host
# Apple ARM64 Config
build:apple_arm --platforms=//build_tools/platforms:osx_arm
build:apple_arm --apple_platform_type=macos
build:apple_arm --cpu=darwin_arm64
build:apple_arm --host_cpu=darwin_arm64
build:apple_arm --crosstool_top=@bazel_tools//tools/cpp:apple_cc_toolchain
# Additional settings can be added as needed
# Address sanitizer
# To use it: bazel build --config asan
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1
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
# Thread sanitizer
# bazel build --config tsan
build:tsan --strip=never
build:tsan --copt -fsanitize=thread
build:tsan --copt -DTHREAD_SANITIZER
build:tsan --copt -DDYNAMIC_ANNOTATIONS_ENABLED=1
build:tsan --copt -DDYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1
build:tsan --copt -O1
build:tsan --copt -fno-omit-frame-pointer
build:tsan --linkopt -fsanitize=thread
# --config msan: Memory sanitizer
build:msan --strip=never
build:msan --copt -fsanitize=memory
build:msan --copt -DADDRESS_SANITIZER
build:msan --copt -O1
build:msan --copt -fno-omit-frame-pointer
build:msan --linkopt -fsanitize=memory
# --config ubsan: Undefined Behavior Sanitizer
build:ubsan --strip=never
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -O1
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --linkopt -lubsan