1# -*- mode: python; -*-
2
3Import('env')
4Import("has_option")
5
6env = env.Clone()
7
8env.Library(
9    target='network',
10    source=[
11        "cidr.cpp",
12        "hostandport.cpp",
13        "hostname_canonicalization.cpp",
14        "listen.cpp",
15        "message.cpp",
16        "message_port.cpp",
17        "op_msg.cpp",
18        "private/socket_poll.cpp",
19        "private/ssl_expiration.cpp",
20        "sock.cpp",
21        "sockaddr.cpp",
22        "socket_exception.cpp",
23        "ssl_manager.cpp",
24        "ssl_options.cpp",
25        "ssl_parameters.cpp",
26        "thread_idle_callback.cpp",
27        env.Idlc('ssl_parameters.idl')[0],
28    ],
29    LIBDEPS=[
30        '$BUILD_DIR/mongo/base',
31        '$BUILD_DIR/mongo/db/auth/auth_rolename',
32        '$BUILD_DIR/mongo/util/concurrency/ticketholder',
33        '$BUILD_DIR/mongo/util/decorable',
34    ],
35    LIBDEPS_PRIVATE=[
36        '$BUILD_DIR/mongo/db/bson/dotted_path_support',
37        '$BUILD_DIR/mongo/db/server_options_core',
38        '$BUILD_DIR/mongo/db/server_parameters',
39        '$BUILD_DIR/mongo/crypto/sha256_block',
40        '$BUILD_DIR/mongo/idl/idl_parser',
41        '$BUILD_DIR/mongo/util/background_job',
42        '$BUILD_DIR/mongo/util/fail_point',
43        '$BUILD_DIR/mongo/util/options_parser/options_parser',
44        '$BUILD_DIR/mongo/util/winutil',
45    ],
46)
47
48env.Library(
49    target='ssl_manager_status',
50    source=[
51        "ssl_manager_status.cpp",
52    ],
53    LIBDEPS=[
54        'network',
55    ],
56    LIBDEPS_PRIVATE=[
57        '$BUILD_DIR/mongo/base',
58        '$BUILD_DIR/mongo/db/commands/server_status',
59    ],
60)
61
62env.CppUnitTest(
63    target='network_test',
64    source=[
65        'cidr_test.cpp',
66        'hostandport_test.cpp',
67        'op_msg_test.cpp',
68        'sock_test.cpp',
69    ],
70    LIBDEPS=[
71        '$BUILD_DIR/mongo/util/fail_point',
72        'network',
73    ],
74)
75
76if has_option('ssl'):
77    env.CppUnitTest(
78        target='ssl_manager_test',
79        source=[
80            'ssl_manager_test.cpp',
81            'ssl_options_test.cpp',
82        ],
83        LIBDEPS=[
84            '$BUILD_DIR/mongo/base',
85            '$BUILD_DIR/mongo/db/server_options',
86            'network',
87        ],
88    )
89
90env.CppIntegrationTest(
91    target='op_msg_integration_test',
92    source=[
93        'op_msg_integration_test.cpp',
94    ],
95    LIBDEPS=[
96        'network',
97        '$BUILD_DIR/mongo/client/clientdriver',
98        '$BUILD_DIR/mongo/util/version_impl',
99    ],
100)
101