-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bazelrc
55 lines (39 loc) · 1.94 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
build --disk_cache=~/.cache/bazel-disk
fetch --disk_cache=~/.cache/bazel-disk
query --disk_cache=~/.cache/bazel-disk
sync --disk_cache=~/.cache/bazel-disk
test --disk_cache=~/.cache/bazel-disk
# Bazel doesn't have a native understanding of C++ versions. This was
# added for Java in 2021; hopefully it might arrive for C++ someday.
build --enable_platform_specific_config
# linux, macos, windows, freebsd, and openbsd.
build:linux --cxxopt='-std=c++17'
build:macos --cxxopt='-std=c++17'
build:windows --cxxopt='-std:c++17' # Note slightly different syntax.
# To run tests that use data files on Windows, you either need to turn
# on use of symlinks on Windows with this setting, or (worse,
# generally) use a Bazel library in your test code to look up test
# file locations.
build:windows --enable_runfiles # requires "developer mode"
# There is also a toolchain selection mechanism suite for
# cross-platform builds or other customizations to the tool chain. Our
# repository does not demonstrate that, but it is worthwhile to review
# the official example:
# https://github.com/bazelbuild/rules_cc/tree/main/examples/custom_toolchain
# Bazel doesn't attempt to be hermetic about the system-provided C
# toolchain by default. You can set the CC environment var to pick a
# different local compiler, and that won't invalidate the cache. To
# get hermetic compiler tooling, use toolchains instead.
# build --repo_env=CC=clang
# work around MacOS C++ debugging bug. A more sophisticated approach
# would use a --config osx on osx and mark this setting build:osx,
# to avoid applying this setting elsewhere.
build --spawn_strategy=local
test --keep_going
test --test_output=all
# test --test_output=errors
# Bazel run output it pretty noisy - see open issue.
# https://github.com/bazelbuild/bazel/issues/4867
run --ui_event_filters=-DEBUG,-INFO,-stderr --noshow_progress
# For production use, consider Aspect's advice on many settings:
# https://blog.aspect.dev/bazelrc-flags