summaryrefslogtreecommitdiff
path: root/src/mongo/embedded/SConscript
blob: 879b5033969e87fdaacaabe7720e641082cfb09a (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
# -*- mode: python; -*-

import re

Import("env")
Import("get_option")
Import("wiredtiger")

env = env.Clone()

env.AppendUnique(
    CPPPATH=["$BUILD_DIR/mongo/embedded"],
)

# Inject this before we call the SDK directory SConscripts so that
# they can both use it.

sdkEnv = env.Clone()

def mongo_export_file_generator(target, source, env, for_signature):
    if env.ToolchainIs('msvc'):
        script = env.File(env.subst("${TARGET.base}.def", target=target))
        return script.get_csig() if for_signature else "/DEF:" + str(script)
    elif env.TargetOSIs('darwin'):
        script = env.File(env.subst("${TARGET.base}.exported_symbols_list", target=target))
        return script.get_csig() if for_signature else "-Wl,-exported_symbols_list," + str(script)
    elif env.TargetOSIs('posix'):
        script = env.File(env.subst("${TARGET.base}.version_script", target=target))
        return script.get_csig() if for_signature else "-Wl,--version-script," + str(script)
    else:
        pass

# We really only want to use the mapfile if we are doing an SDK build. In an ordinary
# dynamic build, we would end up building the normal library with an export map
# but many of its symbols should in fact be coming from other libraries, and we
# get odd ODR-esque violations. UBSAN caught this. Thanks UBSAN!
if get_option('link-model') == 'dynamic-sdk':
    sdkEnv['MONGO_EXPORT_FILE_SHLINKFLAGS'] = mongo_export_file_generator

env.SConscript(
    dirs=[
        'mongo_embedded',
        'mongoc_embedded',
        'stitch_support',
    ],
    exports={
        'env' : sdkEnv,
    },
)

yamlEnv = env.Clone()
yamlEnv.InjectThirdParty(libraries=['yaml'])

env.Library(
    target='embedded',
    source=[
        'embedded.cpp',
        'embedded_auth_manager.cpp',
        'embedded_auth_session.cpp',
        'embedded_ismaster.cpp',
        'embedded_options.cpp',
        'embedded_options_init.cpp',
        'embedded_options_parser_init.cpp',
        'index_builds_coordinator_embedded.cpp',
        'periodic_runner_embedded.cpp',
        'process_interface_factory_embedded.cpp',
        'read_concern_embedded.cpp',
        'read_write_concern_defaults_cache_lookup_embedded.cpp',
        'replication_coordinator_embedded.cpp',
        'service_entry_point_embedded.cpp',
        'transaction_coordinator_factory_embedded.cpp',
        'transaction_coordinator_worker_curop_repository_embedded.cpp',
        'transaction_coordinator_curop_embedded.cpp',
        'embedded_options.idl',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/audit',
        '$BUILD_DIR/mongo/db/auth/auth',
        '$BUILD_DIR/mongo/db/catalog/catalog_impl',
        '$BUILD_DIR/mongo/db/catalog/index_key_validate',
        '$BUILD_DIR/mongo/db/command_can_run_here',
        '$BUILD_DIR/mongo/db/commands',
        '$BUILD_DIR/mongo/db/commands/fsync_locked',
        '$BUILD_DIR/mongo/db/commands/mongod_fcv',
        '$BUILD_DIR/mongo/db/commands/standalone',
        '$BUILD_DIR/mongo/db/concurrency/lock_manager',
        '$BUILD_DIR/mongo/db/fcv_op_observer',
        '$BUILD_DIR/mongo/db/index/index_access_method_factory',
        '$BUILD_DIR/mongo/db/index/index_access_methods',
        '$BUILD_DIR/mongo/db/index_builds_coordinator_interface',
        '$BUILD_DIR/mongo/db/logical_session_cache',
        '$BUILD_DIR/mongo/db/logical_session_cache_impl',
        '$BUILD_DIR/mongo/db/op_observer_impl',
        '$BUILD_DIR/mongo/db/pipeline/process_interface/mongod_process_interfaces',
        '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
        '$BUILD_DIR/mongo/db/repl/replica_set_messages',
        '$BUILD_DIR/mongo/db/repl/storage_interface_impl',
        '$BUILD_DIR/mongo/db/rw_concern_d',
        '$BUILD_DIR/mongo/db/s/sharding_api_d',
        '$BUILD_DIR/mongo/db/server_options',
        '$BUILD_DIR/mongo/db/server_options_base',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/service_entry_point_common',
        '$BUILD_DIR/mongo/db/service_liaison_mongod',
        '$BUILD_DIR/mongo/db/sessions_collection_standalone',
        '$BUILD_DIR/mongo/db/startup_recovery',
        '$BUILD_DIR/mongo/db/storage/storage_control',
        '$BUILD_DIR/mongo/db/storage/storage_engine_common',
        '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
        '$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
        '$BUILD_DIR/mongo/db/storage/storage_init_d',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        '$BUILD_DIR/mongo/db/vector_clock_trivial',
        '$BUILD_DIR/mongo/db/wire_version',
        '$BUILD_DIR/mongo/rpc/client_metadata',
        '$BUILD_DIR/mongo/util/latch_analyzer' if get_option('use-diagnostic-latches') == 'on' else [],
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
        '$BUILD_DIR/mongo/util/version_impl',
    ]
)