File: meson.build

package info (click to toggle)
isc-kea 3.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,036 kB
  • sloc: cpp: 594,791; sh: 26,896; lex: 8,540; yacc: 8,424; python: 1,065; xml: 149; makefile: 39
file content (96 lines) | stat: -rw-r--r-- 2,625 bytes parent folder | download
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
if not FUZZ_OPT.enabled()
    subdir_done()
endif

current_build_dir = meson.current_build_dir()
current_source_dir = meson.current_source_dir()

foreach i : [
    'fuzz_config_kea_dhcp4',
    'fuzz_config_kea_dhcp6',
    'fuzz_http_endpoint_kea_dhcp4',
    'fuzz_http_endpoint_kea_dhcp6',
    'fuzz_packets_kea_dhcp4',
    'fuzz_packets_kea_dhcp6',
    'fuzz_unix_socket_kea_dhcp4',
    'fuzz_unix_socket_kea_dhcp6',
    'fuzz_config_kea_dhcp4/doc-examples',
    'fuzz_config_kea_dhcp6/doc-examples',
]
    command = run_command(GRABBER, f'input/@i@', '*', check: true)
    foreach j : command.stdout().strip().split('\n')
        # configure_file doesn't work with path segments in the output, so let
        # us simulate it with commands.
        run_command(
            ['mkdir', '-p', f'@TOP_BUILD_DIR@/fuzz/input/@i@'],
            check: true,
        )
        run_command(
            ['cp', f'input/@i@/@j@', f'@TOP_BUILD_DIR@/fuzz/input/@i@/@j@'],
            check: true,
        )
    endforeach

endforeach

fuzz_sources = ['fuzz.cc', 'fuzz.h', 'main.cc']
cpp_flags = [
    f'-DKEA_LFC_INSTALLATION="@KEA_LFC_INSTALLED@"',
    f'-DKEA_LFC_SOURCES="@KEA_LFC_BUILT@"',
]

includes = [include_directories('.')] + INCLUDES

fuzz_lib = static_library(
    'fuzz_lib',
    fuzz_sources,
    cpp_args: cpp_flags,
    dependencies: [CRYPTO_DEP, GTEST_DEP],
    include_directories: includes,
    link_with: LIBS_BUILT_SO_FAR,
)

FUZZER_EXECUTABLES = []

foreach i : [
    'fuzz_config_kea_dhcp4',
    'fuzz_http_endpoint_kea_dhcp4',
    'fuzz_packets_kea_dhcp4',
    'fuzz_unix_socket_kea_dhcp4',
]
    FUZZER_EXECUTABLES += executable(
        i,
        f'@i@.cc',
        fuzz_sources,
        cpp_args: cpp_flags,
        dependencies: [CRYPTO_DEP, GTEST_DEP],
        include_directories: includes,
        link_with: [dhcp4_lib, kea_testutils_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
        install: true,
        install_dir: SBINDIR,
        install_rpath: INSTALL_RPATH,
        build_rpath: BUILD_RPATH,
    )
endforeach
foreach i : [
    'fuzz_config_kea_dhcp6',
    'fuzz_http_endpoint_kea_dhcp6',
    'fuzz_packets_kea_dhcp6',
    'fuzz_unix_socket_kea_dhcp6',
]
    FUZZER_EXECUTABLES += executable(
        i,
        f'@i@.cc',
        fuzz_sources,
        cpp_args: cpp_flags,
        dependencies: [CRYPTO_DEP, GTEST_DEP],
        include_directories: includes,
        link_with: [dhcp6_lib, kea_testutils_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
        install: true,
        install_dir: SBINDIR,
        install_rpath: INSTALL_RPATH,
        build_rpath: BUILD_RPATH,
    )
endforeach

subdir('tests')