-
Notifications
You must be signed in to change notification settings - Fork 199
/
Copy pathBLADE_ROOT
149 lines (134 loc) · 4.83 KB
/
BLADE_ROOT
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
def get_env(s):
import os
return os.environ[s] if s in os.environ else None
def get_build_dir():
return 'build%d_%s' % (build_target.bits,
'debug' if build_target.is_debug() else 'release')
global_config(
duplicated_source_action='error',
test_timeout=600, # In seconds
glob_error_severity='error',
legacy_public_targets=load_value('build/blade/legacy_public_targets.conf'),
)
cc_test_config(
# `initial-exec` TLS does not work quite well on ppc64le if dynamic linking
# is used.
dynamic_link=not build_target.is_debug() and build_target.arch != 'ppc64le',
# Doesn't work quite right on AArch64. (It does work on ppc64le, though.)
#
# Stacktrace suggests that it's related to global initialization order
# fiasco.
heap_check='strict' if build_target.arch != 'aarch64' else '',
gperftools_libs='thirdparty/gperftools:tcmalloc',
gtest_libs=['thirdparty/googletest:gtest', '#pthread'],
gtest_main_libs=['thirdparty/googletest:gtest_main'],
pprof_path='thirdparty/gperftools/bin/pprof',
)
cc_config(
cppflags=[
'-gdwarf-2',
'-mcx16' if build_target.arch == 'x86_64' else '',
'-fno-var-tracking',
'-gno-column-info',
],
cflags='-std=gnu11',
cxxflags=[
'-std=gnu++2a',
# This option must be applied here. Options applied in `warnings` are
# not applied to generated source files (e.g., those generated by
# `protoc`.). In practice, `-Wpsabi` produces some diagnostics when
# compiling `.pb.cc` on ppc64le, this option suppress those diagnostics.
'-Wno-psabi' if build_target.arch == 'ppc64le' else '',
],
# NOTE: Please keep all warnings in order in one same group.
warnings=[
'-Werror',
'-Wall',
'-Wextra',
# other useful warnings
'-Warray-bounds',
'-Wchar-subscripts',
'-Wcomment',
'-Wendif-labels',
'-Wformat=1',
# '-Wframe-larger-than=69632', # A 64k buffer and other small vars
'-Wmissing-include-dirs',
'-Wmultichar',
'-Wparentheses',
'-Wpointer-arith',
'-Wreturn-type',
'-Wsequence-point',
'-Wswitch',
'-Wunused-function',
'-Wunused-label',
'-Wunused-result',
'-Wunused-value',
'-Wwrite-strings',
# Suppress all warnings which we can't handle or are misreported.
# Even if some them are sure useful, too many warnings also overwhelm
# the true problems.
'-Wno-format-truncation',
'-Wno-float-equal',
# '-Wno-incompatible-pointer-types',
# Causes too many 'note's when it is disabled due to the size of the code
'-Wno-misleading-indentation',
'-Wno-missing-field-initializers',
'-Wno-sign-compare',
'-Wno-strict-aliasing',
'-Wno-unused-but-set-variable',
'-Wno-unused-local-typedefs',
'-Wno-unused-parameter',
],
# C++ only warning flags
cxx_warnings=[
'-Wnon-virtual-dtor',
'-Woverloaded-virtual',
# Suppress all warnings which we can't handle or are misreported.
'-Wno-deprecated',
'-Wno-invalid-offsetof',
],
extra_incs=[
# for all thirdparty packages
'thirdparty/',
'%s/thirdparty/' % get_build_dir(),
],
linkflags=[
# We need this in some platforms for `link_all_symbols=True` to work.
'-Wl,--no-as-needed',
'-lpthread',
],
benchmark_libs=['//thirdparty/benchmark:benchmark'],
benchmark_main_libs=['//thirdparty/benchmark:benchmark_main'],
allowed_undeclared_hdrs=load_value('build/blade/allowed_undeclared_hdrs.conf'),
# header_inclusion_dependencies = True,
hdr_dep_missing_severity='error',
)
cc_binary_config(run_lib_paths=['//thirdparty/jdk/lib'],)
cc_library_config(
generate_dynamic=True,
arflags=['rcsDT'],
prebuilt_libpath_pattern='lib${bits}',
hdrs_missing_severity='error',
hdrs_missing_suppress=load_value('build/blade/hdrs_missing_suppress.conf'),
)
proto_library_config(
protoc='thirdparty/protobuf/bin/%s/protoc-3.4.1' % build_target.arch,
protobuf_libs=['//thirdparty/protobuf:protobuf'],
protobuf_path='thirdparty',
protobuf_incs='thirdparty/protobuf-3.4.1/src',
protoc_direct_dependencies=True,
well_known_protos=[
'google/protobuf/any.proto',
'google/protobuf/api.proto',
'google/protobuf/compiler/plugin.proto',
'google/protobuf/descriptor.proto',
'google/protobuf/duration.proto',
'google/protobuf/empty.proto',
'google/protobuf/field_mask.proto',
'google/protobuf/source_context.proto',
'google/protobuf/struct.proto',
'google/protobuf/timestamp.proto',
'google/protobuf/type.proto',
'google/protobuf/wrappers.proto',
],
)