Repository navigation
Expand file tree
/
Copy pathBgpBB.cmake
More file actions
218 lines (189 loc) · 4.35 KB
/
Copy pathBgpBB.cmake
File metadata and controls
218 lines (189 loc) · 4.35 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
find_library(BGP_BB_FBOSS_NODEBASE_LIBRARY nodebase REQUIRED)
find_library(BGP_BB_FBOSS_RADIX_TREE_LIBRARY radix_tree REQUIRED)
find_library(
BGP_BB_FBOSS_EXPONENTIAL_BACK_OFF_LIBRARY
exponential_back_off
REQUIRED
)
set(BGP_BB_FBOSS_LIBS
${BGP_BB_FBOSS_NODEBASE_LIBRARY}
${BGP_BB_FBOSS_RADIX_TREE_LIBRARY}
${BGP_BB_FBOSS_EXPONENTIAL_BACK_OFF_LIBRARY}
${FBOSS_LOG_THRIFT_CALL}
${FBOSS_ALERT_LOGGER}
)
add_library(bgp_config_bb
neteng/fboss/bgp/cpp/config/ConfigBB.cpp
)
target_link_libraries(bgp_config_bb
bgp_config_policy
)
add_library(bgp_stats_bb
neteng/fboss/bgp/cpp/stats/StatsBB.cpp
)
target_link_libraries(bgp_stats_bb
bgp_stats_base
fb303::fb303
${BGP_BASE_LIBS}
)
add_library(bgp_netlink_wrapper
neteng/fboss/bgp/cpp/nexthopTracker/NetlinkWrapper.cpp
)
target_link_libraries(bgp_netlink_wrapper
bgp_common
bgp_lib_core
bgp_lib_transport
bgp_nexthop
bgp_stats_base
bgp_watchdog
thrift::rpc
${BGP_BASE_LIBS}
${OPENR_LIBS}
${RE2}
)
add_library(bgp_fib_ebb
neteng/fboss/bgp/cpp/rib/FibEbb.cpp
)
target_link_libraries(bgp_fib_ebb
bgp_common
bgp_fib_holddown
bgp_fib_out
bgp_lib_core
bgp_stats_base
thrift::rpc
${BGP_BASE_LIBS}
${OPENR_LIBS}
)
add_library(bgp_rib_bb
neteng/fboss/bgp/cpp/rib/RibBB.cpp
)
target_link_libraries(bgp_rib_bb
bgp_fib_ebb
bgp_rib_base
bgp_stats_bb
)
add_library(bgp_peer_bb
neteng/fboss/bgp/cpp/peer/PeerManagerBB.cpp
)
target_link_libraries(bgp_peer_bb
bgp_peer_base
)
add_library(bgp_health_bb
neteng/fboss/bgp/cpp/health/HealthValidatorBB.cpp
)
target_link_libraries(bgp_health_bb
bgp_netlink_wrapper
bgp_service_base
${BGP_BASE_LIBS}
)
add_library(bgp_service_bb
neteng/fboss/bgp/cpp/BgpServiceBB.cpp
)
target_link_libraries(bgp_service_bb
bgp_health_bb
bgp_netlink_wrapper
bgp_peer_bb
bgp_rib_bb
bgp_service_base
bgp_stats_bb
)
install(TARGETS
bgp_config_bb
bgp_stats_bb
bgp_netlink_wrapper
bgp_fib_ebb
bgp_rib_bb
bgp_peer_bb
bgp_health_bb
bgp_service_bb
DESTINATION lib
)
add_library(bgp_main_util_bb
neteng/fboss/bgp/cpp/MainUtilBB.cpp
)
target_link_libraries(bgp_main_util_bb
thrift::rpc
bgp_config_cpp2
bgp_stats_base
${BGP_BASE_LIBS}
${OPENR_LIBS}
)
add_executable(bgp_bb_bin
neteng/fboss/bgp/cpp/MainBBOSS.cpp
)
set(BGP_BB_LINK_GROUP_LIBS
${BGP_THRIFT_LIBS}
${OPENR_LIBS}
${BGP_BB_FBOSS_LIBS}
)
list(JOIN BGP_BB_LINK_GROUP_LIBS "," BGP_BB_LINK_GROUP_LIBS_CSV)
target_link_libraries(bgp_bb_bin
bgp_config_bb
bgp_main_util_bb
bgp_netlink_wrapper
bgp_peer_bb
bgp_rib_bb
bgp_service_bb
bgp_stats_base
bgp_stats_bb
build_info
"$<LINK_GROUP:RESCAN,${BGP_BB_LINK_GROUP_LIBS_CSV}>"
${BGP_BASE_LIBS}
thrift::rpc
${FOLLY_EXCEPTION_TRACER}
)
set_target_properties(bgp_bb_bin PROPERTIES OUTPUT_NAME bgp_bb)
install(TARGETS bgp_bb_bin DESTINATION sbin)
if (BUILD_TESTING)
configure_file(
cmake/OssTestMain.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/OssTestMain.cpp
COPYONLY
)
add_executable(bgp_platform_constant_bb_test
neteng/fboss/bgp/cpp/tests/PlatformConstantBbTest.cpp
)
add_dependencies(bgp_platform_constant_bb_test bgp_structs_cpp2)
target_link_libraries(bgp_platform_constant_bb_test
thrift::rpc
fmt::fmt
Folly::folly
GTest::gtest_main
${RE2}
)
add_test(
NAME bgp_platform_constant_bb_test
COMMAND bgp_platform_constant_bb_test
)
add_executable(bgp_stats_bb_test
${CMAKE_CURRENT_BINARY_DIR}/OssTestMain.cpp
neteng/fboss/bgp/cpp/tests/StatsBBTest.cpp
)
target_link_libraries(bgp_stats_bb_test
bgp_stats_bb
GTest::gtest
"$<LINK_GROUP:RESCAN,${BGP_BB_LINK_GROUP_LIBS_CSV}>"
${RE2}
)
add_test(
NAME bgp_stats_bb_test
COMMAND bgp_stats_bb_test
)
add_test(
NAME bgp_bb_version_test
COMMAND bgp_bb_bin --version
)
endif()