# -*- mode: python -*- Import('env') env = env.Clone() env.Library( target='transport_layer_common', source=[ 'hello_metrics.cpp', 'session.cpp', 'transport_layer.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/wire_version', '$BUILD_DIR/mongo/util/net/ssl_manager', ], ) 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=[ '$BUILD_DIR/third_party/shim_asio', 'service_executor', ], ) tlEnv.Library( target='transport_layer', source=[ 'transport_layer_asio.cpp', 'asio_utils.cpp', 'baton_asio_linux.cpp' if env.TargetOSIs('linux') else [], 'session_asio.cpp', 'proxy_protocol_header_parser.cpp', 'transport_options.idl', ], LIBDEPS=[ '$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', '$BUILD_DIR/mongo/util/executor_stats', 'transport_layer_common', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/server_feature_flags', '$BUILD_DIR/mongo/idl/feature_flag', '$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.cpp', 'service_executor_fixed.cpp', 'service_executor_reserved.cpp', 'service_executor_synchronous.cpp', 'service_executor_utils.cpp', 'service_executor.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/service_context', ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/db/server_options_core", "$BUILD_DIR/mongo/idl/server_parameter", "$BUILD_DIR/mongo/util/concurrency/thread_pool", "$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_entry_point_impl.idl', 'service_state_machine.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authentication_restriction', '$BUILD_DIR/mongo/db/dbmessage', '$BUILD_DIR/mongo/db/query/command_request_response', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/rpc/message', '$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=[ 'message_compressor_options_client.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'message_compressor', ], ) env.Library( target='message_compressor_options_server', source=[ 'message_compressor_options_server.idl', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'message_compressor', ], ) tlEnv.CppUnitTest( target='transport_test', source=[ 'asio_utils_test.cpp', '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', 'proxy_protocol_header_parser_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/db/dbmessage', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/service_context_test_fixture', '$BUILD_DIR/mongo/rpc/message', '$BUILD_DIR/mongo/rpc/rpc', '$BUILD_DIR/mongo/unittest/unittest', '$BUILD_DIR/mongo/util/clock_source_mock', '$BUILD_DIR/mongo/util/concurrency/thread_pool', '$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', ], ) tlEnvTest = tlEnv.Clone() tlEnvTest.Append( # TODO(SERVER-54659): Work around casted nullptrs in # asio/impl/connect.hpp, which has an open PR upstream # https://github.com/chriskohlhoff/asio/pull/882, and will # hopefully arrive in a future released version to which we will # upgrade per SERVER-54569. CCFLAGS=[] if env.TargetOSIs('windows') else [ '-Wno-nonnull', ], ) tlEnvTest.CppIntegrationTest( target='transport_integration_test', source=[ 'transport_layer_asio_integration_test.cpp', ], LIBDEPS=[ '$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', 'transport_layer_egress_init', ], )