# -*- mode: python -*- Import("env") Import("has_option") env = env.Clone() env.Library( target="test_commands_enabled", source=[ "test_commands_enabled.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/server_parameters', "server_status_core", ] ) env.Library( target='server_status_core', source=[ 'server_status_internal.cpp', 'server_status_metric.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ] ) env.Library( target='server_status', source=[ 'server_status.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/authcore', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/transport/message_compressor', '$BUILD_DIR/mongo/transport/service_executor', '$BUILD_DIR/mongo/util/net/network', '$BUILD_DIR/mongo/util/processinfo', 'server_status_core', ], ) env.Library( target="write_commands_common", source=[ "write_commands/write_commands_common.cpp", ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authcore', '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/ops/write_ops_parsers', ], ) env.Library( target="feature_compatibility_parsers", source=[ "feature_compatibility_version_parser.cpp", "feature_compatibility_version_command_parser.cpp", ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/command_generic_argument', '$BUILD_DIR/mongo/db/namespace_string', ], ) # Commands available in every process that executes commands env.Library( target="core", source=[ "copydb_common.cpp", "fail_point_cmd.cpp", "find_and_modify_common.cpp", "generic.cpp", "hashcmd.cpp", "parameters.cpp", "rename_collection_common.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/authcore', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/log_process_details', '$BUILD_DIR/mongo/logger/parse_log_component_settings', ], ) # Commands available in all mongodb server processes (mongod, mongos, etc.) env.Library( target="servers", source=[ "authentication_commands.cpp", "conn_pool_stats.cpp", "conn_pool_sync.cpp", "connection_status.cpp", "end_sessions_command.cpp", "generic_servers.cpp", "isself.cpp", "kill_all_sessions_by_pattern_command.cpp", "kill_all_sessions_command.cpp", "kill_sessions_command.cpp", "mr_common.cpp", "reap_logical_session_cache_now.cpp", "refresh_logical_session_cache_now.cpp", "refresh_sessions_command.cpp", "refresh_sessions_command_internal.cpp", "start_session_command.cpp", "user_management_commands_common.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/audit', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/client/clientdriver', '$BUILD_DIR/mongo/db/kill_sessions', '$BUILD_DIR/mongo/db/logical_session_cache', '$BUILD_DIR/mongo/db/logical_session_cache_impl', '$BUILD_DIR/mongo/db/logical_session_id', '$BUILD_DIR/mongo/db/logical_session_id_helpers', '$BUILD_DIR/mongo/db/repl/isself', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/executor/task_executor_pool', '$BUILD_DIR/mongo/s/sharding_legacy_api', '$BUILD_DIR/mongo/s/coreshard', '$BUILD_DIR/mongo/scripting/scripting_common', '$BUILD_DIR/mongo/util/ntservice', 'core', 'feature_compatibility_parsers', ] ) env.Library( target="mongod_fsync", source=[ "fsync.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', '$BUILD_DIR/mongo/db/curop', '$BUILD_DIR/mongo/db/storage/mmap_v1/storage_mmapv1', 'fsync_locked', ] ) env.Library( target="mongod_fcv", source=[ "feature_compatibility_version.cpp", ], LIBDEPS=[ 'feature_compatibility_parsers', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/kill_sessions_local', ], ) env.Library( target='fsync_locked', source=[ 'fsync_locked.cpp', ], LIBDEPS=[ ], ) # Commands that are present in both mongod and embedded env.Library( target="standalone", source=[ "collection_to_capped.cpp", "count_cmd.cpp", "create_indexes.cpp", "current_op.cpp", "dbcommands.cpp", "distinct.cpp", "drop_indexes.cpp", "explain_cmd.cpp", "find_and_modify.cpp", "find_cmd.cpp", "geo_near_cmd.cpp", "getmore_cmd.cpp", "index_filter_commands.cpp", "kill_op.cpp", "killcursors_cmd.cpp", "lock_info.cpp", "list_collections.cpp", "list_databases.cpp", "list_indexes.cpp", "pipeline_command.cpp", "plan_cache_commands.cpp", "rename_collection_cmd.cpp", "repair_cursor.cpp", "run_aggregate.cpp", "validate.cpp", "write_commands/write_commands.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/ops/write_ops_exec', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/command_can_run_here', '$BUILD_DIR/mongo/db/curop_failpoint_helpers', '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/repair_database', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/db/views/views_mongod', 'core', 'current_op_common', 'fsync_locked', 'kill_common', 'list_collections_filter', 'write_commands_common', ], ) # Commands required by the shell to connect env.Library( target="shell_protocol", source=[ "test_commands.cpp", "whats_my_uri_cmd.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/catalog_impl', '$BUILD_DIR/mongo/db/commands', 'test_commands_enabled', ], ) # Commands that should only be present in mongod env.Library( target="mongod", source=[ "apply_ops_cmd.cpp", "clone.cpp", "clone_collection.cpp", "compact.cpp", "copydb.cpp", "copydb_start_commands.cpp", "cpuload.cpp", "dbcheck.cpp", "dbcommands_d.cpp", "dbhash.cpp", "do_txn_cmd.cpp", "driverHelpers.cpp", "eval.cpp", "get_last_error.cpp", "group_cmd.cpp", "haystack.cpp", "mr.cpp", "oplog_application_checks.cpp", "oplog_note.cpp", "parallel_collection_scan.cpp", "resize_oplog.cpp", "restart_catalog_command.cpp", "set_feature_compatibility_version_command.cpp", "shutdown_d.cpp", "snapshot_management.cpp", "top_command.cpp", "touch.cpp", "txn_cmds.cpp", "user_management_commands.cpp", ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver', '$BUILD_DIR/mongo/db/auth/authmongod', '$BUILD_DIR/mongo/db/background', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/catalog_impl', '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/cloner', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/exec/stagedebug_cmd', '$BUILD_DIR/mongo/db/index_d', '$BUILD_DIR/mongo/db/repl/dbcheck', '$BUILD_DIR/mongo/db/repl/oplog', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/db/s/sharding_catalog_manager', '$BUILD_DIR/mongo/s/sharding_legacy_api', 'core', 'kill_common', 'mongod_fcv', 'mongod_fsync', 'profile_common', 'servers', 'shell_protocol', 'standalone', 'test_commands_enabled', ], ) env.Library( target='kill_common', source=[ 'killcursors_common.cpp', 'kill_op_cmd_base.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/db/audit', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/query/command_request_response', ], ) env.Library( target='current_op_common', source=[ 'current_op_common.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/db/pipeline/aggregation_request', '$BUILD_DIR/mongo/db/query/command_request_response', '$BUILD_DIR/mongo/db/service_context', ] ) env.Library( target='profile_common', source=[ 'profile_common.cpp', env.Idlc('profile.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/authcore', ], ) env.Library( target="list_collections_filter", source=[ 'list_collections_filter.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ], ) env.CppUnitTest( target="list_collections_filter_test", source=[ "list_collections_filter_test.cpp" ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands/list_collections_filter', ], ) env.CppUnitTest( target="index_filter_commands_test", source=[ "index_filter_commands_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/query/query_planner", "$BUILD_DIR/mongo/db/query/query_test_service_context", "$BUILD_DIR/mongo/db/serveronly", "$BUILD_DIR/mongo/db/service_context_d", "standalone", ], ) env.CppUnitTest( target="mr_test", source=[ "mr_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/repl/replmocks", "$BUILD_DIR/mongo/db/repl/storage_interface_impl", "$BUILD_DIR/mongo/db/serveronly", "$BUILD_DIR/mongo/db/service_context_d", "$BUILD_DIR/mongo/db/service_context_d_test_fixture", "mongod", "servers", ], ) env.CppUnitTest( target="plan_cache_commands_test", source=[ "plan_cache_commands_test.cpp", ], LIBDEPS=[ "$BUILD_DIR/mongo/db/query/query_planner", "$BUILD_DIR/mongo/db/query/query_test_service_context", "$BUILD_DIR/mongo/db/serveronly", "$BUILD_DIR/mongo/db/service_context_d", "standalone", ], ) if has_option('use-cpu-profiler'): profEnv = env.Clone() profEnv.InjectThirdPartyIncludePaths('gperftools') profEnv.Library( target='cpuprofiler', source=[ 'cpuprofile.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/db_raii', ], LIBDEPS_DEPENDENTS=[ '$BUILD_DIR/mongo/mongodmain', ], )