summaryrefslogtreecommitdiff
path: root/src/third_party/benchmark/SConscript
blob: c78879b100106983d51c152fcb4074e2f5025785 (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
# -*- mode: python -*-

Import("env")

env = env.Clone()

if env.TargetOSIs('windows'):
    env.Prepend(CCFLAGS=[
        # 'function' : destructor never returns, potential memory leak
        '/wd4722',
    ])

    env.Append(LIBS=["ShLwApi"])

if not env.TargetOSIs('windows'):
    env.AddToCCFLAGSIfSupported('-Wno-unused-but-set-variable')

env.Append(
    CPPDEFINES=["HAVE_STD_REGEX"],
    CXXFLAGS=[] if env.TargetOSIs('windows') else [
        # TODO(SERVER-59996): Fix warnings with -Wstringop-truncation when possible
        '-Wno-unknown-warning-option',
        '-Wno-stringop-truncation',
    ],
)

src_dir = env.Dir('dist/src')

env.Library(
    target="benchmark",
    source=env.File(
        [
            'benchmark_api_internal.cc',
            'benchmark.cc',
            'benchmark_name.cc',
            'benchmark_register.cc',
            'benchmark_runner.cc',
            'colorprint.cc',
            'commandlineflags.cc',
            'complexity.cc',
            'console_reporter.cc',
            'counter.cc',
            'csv_reporter.cc',
            'json_reporter.cc',
            'reporter.cc',
            'sleep.cc',
            'statistics.cc',
            'string_util.cc',
            'sysinfo.cc',
            'timers.cc',
        ],
        src_dir,
    ),
)