-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmeson.build
More file actions
109 lines (93 loc) · 3.28 KB
/
Copy pathmeson.build
File metadata and controls
109 lines (93 loc) · 3.28 KB
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
project(
'spdmcpp',
'cpp',
'c',
version: '0.1.0',
meson_version: '>=1.1.1',
default_options: ['cpp_std=c++23', 'warning_level=3'],
)
fs = import('fs')
if get_option('tests').enabled()
gtest = dependency('gtest', main: true, disabler: true, required: false)
gmock = dependency('gmock', disabler: true, required: false)
endif
# at the moment we can't use default_option werror=true because it's passed to subprojects and subproject dependencies, and atm specifically fmt fails
add_project_arguments(
['-Werror', '-fno-sanitize=alignment'],
language: ['c', 'cpp'],
)
# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL
# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project
# Basically, gcc 6 and gcc 7 are not ABI compatible, but since the whole OpenBMC
# project uses the same compiler, we can safely ignore these info notes.
add_project_arguments('-Wno-psabi', language: 'cpp')
conf_data = configuration_data()
conf_data.set_quoted('SPDMD_VERSION', meson.project_version())
conf_data.set_quoted('SPDM_WRAPPER_VERSION', meson.project_version())
conf_data.set(
'FETCH_SERIALNUMBER_FROM_RESPONDER',
get_option('fetch_serialnumber_from_responder'),
)
conf_data.set('CSM_SERVICE_ENABLED', get_option('csm_service_enabled').enabled())
conf_data.set(
'DISCOVERY_ONLY_FROM_MCTP_CONTROL',
get_option('discovery_only_from_mctp_control').enabled(),
)
conf_data.set('SPDM_JSON_CONF_FILE_NAME', get_option('conf_file_name'))
conf_data.set('USE_DEFAULT_DBUS', get_option('use_default_dbus').enabled())
conf_data.set('MCTP_IN_KERNEL', get_option('enable-in-kernel-mctp').enabled())
conf_h_dep = declare_dependency(
include_directories: include_directories('.'),
sources: configure_file(
input: 'config.h.in',
output: 'config.h',
configuration: conf_data,
),
)
comp = meson.get_compiler('cpp')
# Try to find mbedcrypto and mbedx509 as system libraries first,
# otherwise fall back to building from subproject
mbedcrypto_dep = dependency(
'mbedcrypto',
required: false,
fallback: ['mbedtls', 'mbedcrypto_dep'],
)
if not mbedcrypto_dep.found()
mbedcrypto_dep = comp.find_library('mbedcrypto')
endif
mbedx509_dep = dependency(
'mbedx509',
required: false,
fallback: ['mbedtls', 'mbedx509_dep'],
)
if not mbedx509_dep.found()
mbedx509_dep = comp.find_library('mbedx509')
endif
crypto_deps = declare_dependency(dependencies: [mbedcrypto_dep, mbedx509_dep])
sdbusplus = dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep'])
phosphor_dbus_interfaces = dependency(
'phosphor-dbus-interfaces',
fallback: ['phosphor-dbus-interfaces', 'phosphor_dbus_interfaces_dep'],
)
sdeventplus = dependency(
'sdeventplus',
fallback: ['sdeventplus', 'sdeventplus_dep'],
)
if comp.has_header('CLI/CLI.hpp')
CLI11_dep = declare_dependency()
else
CLI11_dep = dependency('CLI11', fallback: ['CLI11', 'CLI11_dep'])
endif
if comp.has_header('nlohmann/json.hpp')
nlohmann_json = declare_dependency()
else
nlohmann_json = dependency(
'nlohmann_json',
fallback: ['nlohmann_json', 'nlohmann_json_dep'],
)
endif
subdir('libspdmcpp')
subdir('tools/libmctppacketcorrupt')
subdir('fuzzer')
subdir('spdmd')
subdir('spdmutil')