-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
53 lines (43 loc) · 1.33 KB
/
meson.build
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
project('firmware', 'c', version: '0.0.1')
cc = meson.get_compiler('c')
git = find_program('git')
source_version = run_command([git, 'describe'], check: false).stdout().strip()
conf = configuration_data()
conf.set('COMPILER_NAME', cc.get_id())
conf.set('COMPILER_VERSION', cc.version())
# this is a list of generated or static uSWID files
sbom_built = []
sbom_static = []
# find the binary
uswid = find_program('uswid')
# add a compiler identity so we know what we build this with
sbom_static += configure_file(
input : 'compiler.ini',
output : 'compiler.ini',
configuration : conf,
)
# we import this into EVERY BUILT SBoM component to override values
ini_toplevel = configure_file(
input : 'toplevel.ini',
output : 'toplevel.ini',
configuration : conf,
)
# this is used by multiple UEFI modules
inf2ini = ['python3', files('inf2ini.py')]
subdir('src')
subdir('ucode')
subdir('parachuted')
# build all the small per-component uSWID files into one tiny deduped and compressed blob
args = []
foreach uswid_file: sbom_built
args += [uswid_file.full_path()]
endforeach
foreach uswid_file: sbom_static
args += [uswid_file]
endforeach
uswid_blob = custom_target('demo.uswid',
depends: sbom_built,
output: 'demo.uswid',
command: [uswid, '--verbose', '--compress', '--load', args, '--save', '@OUTPUT@'],
build_by_default: true,
)