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

from functools import partial
import libdeps

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

env = env.Clone()

stitchSupportEnv = env.Clone()
stitchSupportEnv.AppendUnique(
    CPPDEFINES=[
        'STITCH_SUPPORT_COMPILING',
     ],
)

if get_option('link-model') == 'static':
    stitchSupportEnv.AppendUnique(
        CPPDEFINES=[
            'STITCH_SUPPORT_STATIC',
        ],
    )
elif get_option('link-model') == 'dynamic-sdk':
    # TODO(SERVER-59134): This fails to honor the libdeps-debug flag
    stitchSupportEnv['LIBDEPS_SHLIBEMITTER'] = partial(
        libdeps.libdeps_emitter,
        builder='SharedArchive',
        visibility_map=libdeps.dependency_visibility_honored,
    )

# Please see the note in ../mongo_embedded/SConscript about how to
# interpret and adjust the current and compatibility versions.
stitchSupportEnv.AppendUnique(
    SHLINKFLAGS=[
        '$MONGO_EXPORT_FILE_SHLINKFLAGS',
    ],
)

stitchSupportTargets = stitchSupportEnv.Library(
    target='stitch_support',
    source=[
        'stitch_support.cpp',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/index/index_access_methods',
        '$BUILD_DIR/mongo/db/matcher/expressions',
        '$BUILD_DIR/mongo/db/ops/parsed_update',
        '$BUILD_DIR/mongo/db/query/collation/collator_factory_icu',
        '$BUILD_DIR/mongo/db/query/collation/collator_factory_interface',
        '$BUILD_DIR/mongo/db/vector_clock_trivial',
    ],
    AIB_COMPONENT='stitch-support',
)

env.AutoInstall(
    '$PREFIX_INCLUDEDIR/stitch_support/v1/stitch_support',
    source=['stitch_support.h'],
    AIB_COMPONENT='stitch-support',
    AIB_ROLE='dev',
)

if get_option('link-model') != 'dynamic-sdk':
    stitchSupportTestEnv = env.Clone()
    unitTest = stitchSupportTestEnv.CppUnitTest(
        target="stitch_support_test",
        source=[
            "stitch_support_test.cpp",
        ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/unittest/unittest',
            'stitch_support',
        ],
        UNITTEST_HAS_CUSTOM_MAINLINE=True,
        AIB_COMPONENT='stitch-support-test',
    )