-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.bazelrc
74 lines (61 loc) · 2.81 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
try-import submodules/dev-tools/.bazelrc
# Specific Bazel build/test options.
build --enable_platform_specific_config
# Verbose failure logs when something goes wrong.
build --verbose_failures
# By default run both (target) compilation mode and host compilation
# mode in 'fastbuild' so that any "tools" that get build (which are
# built for the host) don't require building things a second time.
build --compilation_mode=fastbuild
build --host_compilation_mode=fastbuild
# Build with clang (rather than the default of gcc) since clang compiles
# templates faster and produces better error messages.
# Prefer repo_env over action_env to avoid invalidating the action graph:
# https://github.com/bazelbuild/bazel/issues/8074
build --repo_env=CC=clang
# We need to always use position independent code because when
# compiling in optimized mode we've run into issues where
# `rules_foreign_cc` requires it for linking.
build --force_pic
# Use Clang as a default compiler on Windows.
# TODO(xander): Does repo_env above cover the windows case?
build:windows --compiler="clang-cl"
# Make it easy to use gcc.
# Prefer repo_env over action_env to avoid invalidating the action graph:
# https://github.com/bazelbuild/bazel/issues/8074
build:gcc --repo_env=CC=gcc
# Build eventuals in C++17 mode.
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
build:windows --cxxopt=/std:c++17
build:windows --host_cxxopt=/std:c++17
# Make an existing directory writable in the sandbox in order
# to prevent build issue on 'make' call from 'configure_make'
# for 'binutils'.
# Check bazel doc:
# https://docs.bazel.build/versions/main/command-line-reference.html
# Example of this issue:
# https://stackoverflow.com/questions/52370202/how-to-get-bazel-ccache-and-sandboxing-to-work-together-ccache-read-only-file
# TODO(artur): find a way to pass '/home/$USER/.cache' as the
# value to '--sandbox_writable_path' option.
build:linux --sandbox_writable_path=/home/
build:macos --sandbox_writable_path=/home/
# TODO(artur): make an existing directory writable in the sandbox
# on Windows too.
# https://github.com/3rdparty/eventuals/issues/450
# On Windows, `__cplusplus` is wrongly defined without this switch.
# See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
build:windows --copt=/Zc:__cplusplus
# Make sure to include as little of windows.h as possible.
# This generally helps with compilation speed.
# It also prevents breaking the One Definition Rule,
# e.g. both wincrypt.h and OpenSSL have their own definitions of
# SSL structs.
build:windows --copt=-DWIN32_LEAN_AND_MEAN
build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
build:windows --copt=-DNOGDI
build:windows --host_copt=-DNOGDI
# Allow users to add local preferences.
try-import %workspace%/user.bazelrc