summaryrefslogtreecommitdiff
path: root/src/mongo/util/net/SConscript
blob: cbdad7a52738ec7f5dcfea7a47697ef7841b4e6f (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
# -*- mode: python; -*-

Import('env')
Import("has_option")
Import('http_client')
Import('ssl_provider')

env = env.Clone()

env.Library(
    target='network',
    source=[
        "cidr.cpp",
        "hostandport.cpp",
        "hostname_canonicalization.cpp",
        "sockaddr.cpp",
        "socket_exception.cpp",
        "socket_utils.cpp",
        env.Idlc('hostandport.idl')[0],
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/util/concurrency/spin_lock',
        '$BUILD_DIR/mongo/util/winutil',
    ],
)

env.Library(
    target='ssl_options',
    source=[
        "ssl_options.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
    ]
)

env.Library(
    target='ssl_options_client',
    source=[
        'ssl_options_client.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'ssl_options',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
    ]
)

env.Library(
    target='ssl_options_server',
    source=[
        'ssl_options_server.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'ssl_options',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
    ]
)

env.Library(
    target='socket',
    source=[
        "private/socket_poll.cpp",
        "sock.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/util/fail_point',
        'network',
    ]
)

env.Library(
    target='ssl_types',
    source=[
        "ssl_types.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/transport/transport_layer_common',
        'ssl_options',
    ]
)

env.Library(
    target='ssl_manager_impl',
    source=[
        "private/ssl_expiration.cpp",
        "ssl_manager.cpp",
        "ssl_parameters.cpp",
        "ssl_manager_%s.cpp" % (ssl_provider) if not ssl_provider == "none" else [],
        "ssl_stream.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/auth/auth',
        '$BUILD_DIR/third_party/shim_asio',
        'network',
        'socket',
        'ssl_options',
        'ssl_types',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/crypto/sha_block_${MONGO_CRYPTO}',
        '$BUILD_DIR/mongo/db/auth/internal_user_auth',
        '$BUILD_DIR/mongo/db/commands/server_status',
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/db/server_parameters',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/util/background_job',
        '$BUILD_DIR/mongo/util/winutil',
    ],
)

env.Library(
    target='ssl_manager_none',
    source=[
        "ssl_manager_none.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'ssl_options',
    ],
)


env.Library(
    target='ssl_manager',
    source=[
        "ssl_dummy.cpp",
    ],
    LIBDEPS=[
        'ssl_manager_impl' if has_option('ssl') else 'ssl_manager_none',
    ],
)

if http_client == "off":
    env.Library(
        target='http_client',
        source=[
            'http_client_none.cpp',
        ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/base',
        ],
    )
else:
    env.Library(
        target='http_client',
        source=[
            'http_client_winhttp.cpp' if env.TargetOSIs('windows') else 'http_client_curl.cpp',
        ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/base',
        ],
        SYSLIBDEPS=[
            'winhttp' if env.TargetOSIs('windows') else 'curl',
        ],
    )

env.CppUnitTest(
    target='network_test',
    source=[
        'cidr_test.cpp',
        'hostandport_test.cpp',
    ],
    LIBDEPS=[
        'network',
    ],
)

if has_option('ssl'):
    env.CppUnitTest(
        target='ssl_manager_test',
        source=[
            'ssl_manager_test.cpp',
            'ssl_options_test.cpp',
            'sock_test.cpp',
        ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/util/fail_point',
            'network',
            '$BUILD_DIR/mongo/db/server_options_servers',
            'socket',
            'ssl_manager',
            'ssl_options_server',
        ],
    )