summaryrefslogtreecommitdiff
path: root/src/mongo/transport/SConscript
blob: ab1e34c702ba84637bc8691b9fe99c86e25bbd34 (plain)
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
# -*- mode: python -*-

Import('env')

env = env.Clone()

env.Library(
    target='transport_layer_common',
    source=[
        'ismaster_metrics.cpp',
        'service_entry_point_utils.cpp',
        'session.cpp',
        'transport_layer.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/service_context',
    ],
)

env.Library(
    target='transport_layer_mock',
    source=[
        'transport_layer_mock.cpp',
    ],
    LIBDEPS=[
        'transport_layer_common',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/util/net/network',
    ],
)

tlEnv = env.Clone()
tlEnv.InjectThirdParty(libraries=['asio'])

tlEnv.Library(
    target='transport_layer_manager',
    source=[
        'transport_layer_manager.cpp',
    ],
    LIBDEPS=[
        'transport_layer',
    ],
    LIBDEPS_PRIVATE=[
        'service_executor',
        '$BUILD_DIR/third_party/shim_asio',
    ],
)

tlEnv.Library(
    target='transport_layer',
    source=[
        'transport_layer_asio.cpp',
        env.Idlc('transport_options.idl')[0],
    ],
    LIBDEPS=[
        'transport_layer_common',
        '$BUILD_DIR/mongo/base/system_error',
        '$BUILD_DIR/mongo/db/auth/authentication_restriction',
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/stats/counters',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/idl/server_parameter',
        '$BUILD_DIR/mongo/util/net/ssl_manager',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
        '$BUILD_DIR/third_party/shim_asio',
    ],
)

# This library will initialize an egress transport layer in a mongo initializer
# for C++ tests that require networking.
env.Library(
    target='transport_layer_egress_init',
    source=[
        'transport_layer_egress_init.cpp',
    ],
    LIBDEPS_PRIVATE=[
        'transport_layer',
    ]
)

tlEnv.Library(
    target='service_executor',
    source=[
        'service_executor_reserved.cpp',
        'service_executor_synchronous.cpp',
        env.Idlc('service_executor.idl')[0],
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/service_context',
    ],
    LIBDEPS_PRIVATE=[
        "$BUILD_DIR/mongo/idl/server_parameter",
        "$BUILD_DIR/mongo/util/processinfo",
        '$BUILD_DIR/third_party/shim_asio',
        'transport_layer_common',
    ],
)

env.Library(
    target='service_entry_point',
    source=[
        'service_entry_point_impl.cpp',
        'service_state_machine.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/auth/authentication_restriction',
        '$BUILD_DIR/mongo/db/dbmessage',
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/stats/counters',
        '$BUILD_DIR/mongo/rpc/protocol',
        '$BUILD_DIR/mongo/util/processinfo',
        'service_executor',
        'transport_layer_common',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/traffic_recorder',
        '$BUILD_DIR/mongo/transport/message_compressor',
        '$BUILD_DIR/mongo/util/net/ssl_manager',
    ],
)

zlibEnv = env.Clone()
zlibEnv.InjectThirdParty(libraries=['zlib', 'zstd', 'snappy'])
zlibEnv.Library(
    target='message_compressor',
    source=[
        'message_compressor_manager.cpp',
        'message_compressor_metrics.cpp',
        'message_compressor_registry.cpp',
        'message_compressor_snappy.cpp',
        'message_compressor_zlib.cpp',
        'message_compressor_zstd.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
        '$BUILD_DIR/third_party/shim_snappy',
        '$BUILD_DIR/third_party/shim_zlib',
        '$BUILD_DIR/third_party/shim_zstd',
    ]
)

env.Library(
    target='message_compressor_options_client',
    source=[
        env.Idlc('message_compressor_options_client.idl')[0],
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'message_compressor',
    ],
)

env.Library(
    target='message_compressor_options_server',
    source=[
        env.Idlc('message_compressor_options_server.idl')[0],
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'message_compressor',
    ],
)

tlEnv.CppUnitTest(
    target='transport_test',
    source=[
        'message_compressor_manager_test.cpp',
        'message_compressor_registry_test.cpp',
        'transport_layer_asio_test.cpp',
        'service_executor_test.cpp',
        'max_conns_override_test.cpp',
        'service_state_machine_test.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/dbmessage',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/rpc/protocol',
        '$BUILD_DIR/mongo/rpc/rpc',
        '$BUILD_DIR/mongo/unittest/unittest',
        '$BUILD_DIR/mongo/util/clock_source_mock',
        '$BUILD_DIR/mongo/util/net/socket',
        '$BUILD_DIR/third_party/shim_asio',
        'message_compressor',
        'message_compressor_options_server',
        'service_entry_point',
        'service_executor',
        'transport_layer',
        'transport_layer_common',
        'transport_layer_mock',
    ],
)

tlEnv.CppIntegrationTest(
    target='transport_integration_test',
    source=[
        'transport_layer_asio_integration_test.cpp',
    ],
    LIBDEPS=[
        'transport_layer_egress_init',
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/client/async_client',
        '$BUILD_DIR/mongo/executor/task_executor_interface',
        '$BUILD_DIR/mongo/util/net/network',
        '$BUILD_DIR/mongo/util/version_impl',
        '$BUILD_DIR/third_party/shim_asio',
    ],
)