forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUCK
86 lines (80 loc) · 1.97 KB
/
BUCK
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
load('//:subdir_glob.bzl', 'subdir_glob')
macos_preprocessor_flags = [
'-Wno-expansion-to-defined',
'-DHAVE_PTHREAD=1',
]
linux_preprocessor_flags = [
'-Wno-expansion-to-defined',
'-DHAVE_PTHREAD=1',
]
linux_linker_flags = [
'-pthread',
]
linux_compiler_flags = [
'-pthread',
]
cxx_library(
name = 'protobuf',
header_namespace = 'google',
exported_headers = subdir_glob([
('src/google', 'protobuf/**/*.h'),
('src/google', 'protobuf/**/*.inc'),
], exclude = glob([
'src/google/protobuf/testing/*.h',
'src/google/protobuf/**/*_test*.h',
'src/google/protobuf/**/*test_*.h',
'src/google/protobuf/**/*unittest*.h',
'src/google/protobuf/**/*mock*.h',
])),
srcs = glob([
'src/google/protobuf/**/*.cc',
], exclude = glob([
'src/google/protobuf/compiler/main.cc',
'src/google/protobuf/compiler/js/embed.cc',
'src/google/protobuf/testing/**/*.cc',
'src/google/protobuf/**/*_test*.cc',
'src/google/protobuf/**/*test_*.cc',
'src/google/protobuf/**/*unittest*.cc',
'src/google/protobuf/**/*mock*.cc',
])),
platform_preprocessor_flags = [
('^macos.*', macos_preprocessor_flags),
('^linux.*', linux_preprocessor_flags),
('default', linux_preprocessor_flags),
],
platform_linker_flags = [
('^linux.*', linux_linker_flags),
],
platform_compiler_flags = [
('^linux.*', linux_compiler_flags),
],
visibility = [
'PUBLIC',
],
)
cxx_binary(
name = 'protoc',
srcs = [
'src/google/protobuf/compiler/main.cc',
],
preprocessor_flags = [
'-DOPENSOURCE_PROTOBUF_CPP_BOOTSTRAP=1',
],
platform_preprocessor_flags = [
('^macos.*', [ '-Wno-expansion-to-defined' ]),
('^linux.*', [ '-Wno-expansion-to-defined' ]),
('default', [ '-Wno-expansion-to-defined' ]),
],
platform_linker_flags = [
('^linux.*', linux_linker_flags),
],
platform_compiler_flags = [
('^linux.*', linux_compiler_flags),
],
deps = [
':protobuf',
],
visibility = [
'PUBLIC',
],
)