-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bazelrc
91 lines (73 loc) · 2.56 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Netzwerx Bazel configuration file
# -------------------------------
# ------| CONFIG OPTIONS |-------
# -------------------------------
#
# Compiler options:
# clang: Use clang when building c++ code.
#
# Other build options:
# libc++: Link against libc++ instead of stdlibc++
# asan: Build with the clang address sanitizer
# msan: Build with the clang memory sanitizer
# ubsan: Build with the clang undefined behavior sanitizer
# dbg: Build with debug info
# Default build options
build --action_env=BAZEL_CXXOPTS="-std=c++17"
build --repo_env=CC=clang
# This file tries to group and simplify build options for Netzwerx
# Allow builds using `LLVM C++ Standard Library (libc++)` as a linker library
build:libc++ --action_env=CC
build:libc++ --action_env=CXX
build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
build:libc++ --action_env=PATH
build:libc++ --define force_libcpp=enabled
build:libc++ --linkopt -fuse-ld=lld
# By default, build NW in C++ 17 mode.
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:windows --cxxopt=/std:c++17
build:windows --host_cxxopt=/std:c++17
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
# On windows, we still link everything into a single DLL.
build:windows --config=monolithic
# On linux, we dynamically link small amount of kernels
build:linux --config=dynamic_kernels
# Make sure to include as little of windows.h as possible
build:windows --copt=-DWIN32_LEAN_AND_MEAN
build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
build:windows --copt=-DNOGDI
build:windows --host_copt=-DNOGDI
# Debug config
build:dbg -c dbg
# run @hedron_compile_commands
# run @hedron_compile_commands//:refresh_all
# Address sanitizer
# CC=clang bazel build --config asan
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -g
build:asan --copt -O3
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address
# Memory sanitizer
# CC=clang bazel build --config msan
build:msan --strip=never
build:msan --copt -fsanitize=memory
build:msan --copt -DMEMORY_SANITIZER
build:msan --copt -g
build:msan --copt -O3
build:msan --copt -fno-omit-frame-pointer
build:msan --linkopt -fsanitize=memory
# Undefined Behavior Sanitizer
# CC=clang bazel build --config ubsan
build:ubsan --strip=never
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -DUNDEFINED_BEHAVIOR_SANITIZER
build:ubsan --copt -g
build:ubsan --copt -O3
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --linkopt -lubsan