summaryrefslogtreecommitdiff
path: root/src/mongo/client/embedded/SConscript
blob: 33bf377852bfe4362449e30910bd08115c3235eb (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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# -*- mode: python; -*-

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

env = env.Clone()

env.Library(
    target="service_entry_point_embedded",
    source=[
        "service_entry_point_embedded.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/transport/service_entry_point',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/auth/authcore',
        '$BUILD_DIR/mongo/db/auth/authmongod',
        '$BUILD_DIR/mongo/db/command_can_run_here',
        '$BUILD_DIR/mongo/db/rw_concern_d',
        '$BUILD_DIR/mongo/db/service_entry_point_common',
        '$BUILD_DIR/mongo/db/s/sharding',
        '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
        '$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
    ],
)

env.Library(
    target="service_context_embedded",
    source=[
        "service_context_embedded.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/transport/service_entry_point',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/concurrency/lock_manager',
        '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
        '$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        'service_entry_point_embedded',
    ],
)

env.Library('repl_coordinator_embedded',
    [
        'replication_coordinator_embedded.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
        '$BUILD_DIR/mongo/db/repl/replica_set_messages',
    ],
)

env.Library(
    target="embedded_options",
    source=[
        'embedded_options.cpp',
        'embedded_options_init.cpp',
        'embedded_options_parser_init.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/server_options',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
    ],
)

env.Library(
    target="embedded_commands",
    source=[
        'embedded_commands.cpp',
        'embedded_ismaster.cpp',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/commands',
        '$BUILD_DIR/mongo/db/commands/standalone',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        '$BUILD_DIR/mongo/db/wire_version',
        '$BUILD_DIR/mongo/rpc/client_metadata',
    ],
)

env.Library(
    target='index_create_impl_embedded',
    source=[
        'index_create_impl_embedded.cpp',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/catalog/catalog_impl',
    ],
)

env.Library(
    target='embedded',
    source=[
        'embedded.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/authz_manager_external_state_factory_d',
        '$BUILD_DIR/mongo/db/catalog/catalog_impl',
        '$BUILD_DIR/mongo/db/commands/fsync_locked',
        '$BUILD_DIR/mongo/db/commands/mongod_fcv',
        '$BUILD_DIR/mongo/db/op_observer_d',
        '$BUILD_DIR/mongo/db/repair_database_and_check_version',
        '$BUILD_DIR/mongo/db/repl/repl_set_status_commands',
        '$BUILD_DIR/mongo/db/repl/storage_interface_impl',
        '$BUILD_DIR/mongo/db/storage/mobile/storage_mobile',
        '$BUILD_DIR/mongo/db/storage/storage_init_d',
        '$BUILD_DIR/mongo/util/version_impl',
        'embedded_commands',
        'embedded_options',
        'index_create_impl_embedded',
        'repl_coordinator_embedded',
        'service_context_embedded',
        'service_entry_point_embedded',
    ]
)

capi = env.Library(
    target='mongo_embedded_capi',
    source=[
        'libmongodbcapi.cpp',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/transport/transport_layer_mock',
        'embedded',
    ],
    INSTALL_ALIAS=[
        'mobile-dev',
    ],
)

env.Alias('embedded_capi', capi)

if get_option('install-mode') == 'hygienic':
    env.AutoInstall(
        'include',
        source=['libmongodbcapi.h'],
        INSTALL_ALIAS=[
            'mobile-dev',
        ],
    )

capiTestEnv = env.Clone()
capiTestEnv.InjectThirdPartyIncludePaths(libraries=['yaml'])
capiTest = capiTestEnv.Program(
    target='mongo_embedded_capi_test',
    source=[
        'libmongodbcapi_test.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/commands/shell_protocol',
        '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
        '$BUILD_DIR/mongo/unittest/unittest',
        '$BUILD_DIR/mongo/util/net/network',
        'mongo_embedded_capi',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/server_options_core',
    ],
    INSTALL_ALIAS=[
        'mobile-test',
    ],
)

env.RegisterUnitTest(capiTest[0])
env.Alias('embedded_capi', capiTest)

mongoe_env = env.Clone()
mongoe_env.InjectThirdPartyIncludePaths(libraries=['yaml'])
mongoe = mongoe_env.Program(
    target='mongoe',
    source=[
        'mongoe_main.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/commands/shell_protocol',
        '$BUILD_DIR/mongo/db/mongod_options',
        '$BUILD_DIR/mongo/db/server_options',
        '$BUILD_DIR/mongo/transport/transport_layer_manager',
        '$BUILD_DIR/mongo/util/signal_handlers',
        'embedded',
    ],
    INSTALL_ALIAS=[
        'mobile-test',
    ],
)

hygienic = get_option('install-mode') == 'hygienic'

if not hygienic:
    env.Install('#/', mongoe)


if not env['MONGO_HAVE_LIBMONGOC']:
    Return()

embeddedTransport = env.Library(
    target='mongo_embedded_transport',
    source=[
       'embedded_transport_layer.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'mongo_embedded_capi',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/third_party/shim_zlib',
    ],
    SYSLIBDEPS=[
        'mongoc-1.0',
        'bson-1.0',
    ],
    INSTALL_ALIAS=[
        'mobile-dev',
    ],
)

env.Alias('embedded_capi', embeddedTransport)

if get_option('install-mode') == 'hygienic':
    env.AutoInstall(
        'include',
        source=['embedded_transport_layer.h'],
        INSTALL_ALIAS=[
            'mobile-dev',
        ],
    )

embeddedTransportTestEnv = env.Clone()
embeddedTransportTestEnv.InjectThirdPartyIncludePaths(libraries=['yaml'])
embeddedTransportTest = embeddedTransportTestEnv.Program(
    target='mongo_embedded_transport_test',
    source=[
        'embedded_transport_layer_test.cpp',
        'functions_for_test.cpp',
    ],
    LIBDEPS=[
        'mongo_embedded_transport',
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/unittest/unittest',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/server_options_core',
    ],
    INSTALL_ALIAS=[
        'mobile-test',
    ],
)

env.Alias('embedded_capi', embeddedTransportTest)
env.RegisterUnitTest(embeddedTransportTest[0]);