blob: ab19da55e2890dd4cc0240e77282a4de64716ef2 [file] [log] [blame]
Patrick Williamsbb939ea2021-12-03 15:41:02 -06001project(
2 'phosphor-certificate-manager',
3 'cpp',
4 default_options: [
5 'buildtype=debugoptimized',
Patrick Williams23778dd2023-07-17 10:07:23 -05006 'cpp_std=c++23',
Patrick Williamsbb939ea2021-12-03 15:41:02 -06007 'warning_level=3',
8 'werror=true',
9 ],
Patrick Williams23778dd2023-07-17 10:07:23 -050010 meson_version: '>=1.1.1',
Patrick Williamsbb939ea2021-12-03 15:41:02 -060011)
12
13cpp = meson.get_compiler('cpp')
14
Patrick Williams447d55d2022-03-21 10:18:25 -050015sdbusplus_dep = dependency('sdbusplus')
16sdeventplus_dep = dependency('sdeventplus')
17phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
18phosphor_logging_dep = dependency('phosphor-logging')
Patrick Williamsbb939ea2021-12-03 15:41:02 -060019
Nan Zhou7047be62022-03-10 12:34:06 -080020cli11_dep = dependency('cli11', required: false)
21has_cli11 = meson.get_compiler('cpp').has_header_symbol(
22 'CLI/CLI.hpp',
23 'CLI::App',
24 dependencies: cli11_dep,
25 required: false)
26if not has_cli11
27 cli11_proj = subproject('cli11', required: false)
28 assert(cli11_proj.found(), 'CLI11 is required')
29 cli11_dep = cli11_proj.get_variable('CLI11_dep')
30endif
31
Patrick Williamsbb939ea2021-12-03 15:41:02 -060032systemd_dep = dependency('systemd')
33openssl_dep = dependency('openssl')
34
35config_data = configuration_data()
36config_data.set(
37 'authority_limit',
38 get_option('authority-limit')
39)
Nan Zhou6ec13c82021-12-30 11:34:50 -080040config_data.set(
41 'authorities_list_name',
42 get_option('authorities-list-name')
43)
Patrick Williamsbb939ea2021-12-03 15:41:02 -060044
Lei YU3c478142022-06-27 14:42:47 +080045if not get_option('allow-expired').disabled()
46 config_data.set('allow_expired', 'true')
47else
48 config_data.set('allow_expired', 'false')
49endif
50
Patrick Williamsbb939ea2021-12-03 15:41:02 -060051configure_file(
Patrick Williamse0e2cce2021-12-13 08:40:50 -060052 input: 'config.h.in',
Patrick Williamsbb939ea2021-12-03 15:41:02 -060053 output: 'config.h',
54 configuration: config_data
55)
56
57phosphor_certificate_deps = [
58 openssl_dep,
59 phosphor_dbus_interfaces_dep,
60 phosphor_logging_dep,
61 sdbusplus_dep,
62 sdeventplus_dep,
Nan Zhou7047be62022-03-10 12:34:06 -080063 cli11_dep,
Patrick Williamsbb939ea2021-12-03 15:41:02 -060064]
65
66cert_manager_lib = static_library(
67 'phosphor-certificate-manager',
68 [
69 'argument.cpp',
70 'certificate.cpp',
71 'certs_manager.cpp',
72 'csr.cpp',
73 'watch.cpp',
Nan Zhoue869bb62021-12-30 11:34:42 -080074 'x509_utils.cpp',
Patrick Williamsbb939ea2021-12-03 15:41:02 -060075 ],
76 dependencies: phosphor_certificate_deps,
77)
78
79cert_manager_dep = declare_dependency(
80 link_with: cert_manager_lib,
81 dependencies: phosphor_certificate_deps
82)
83
84executable(
85 'phosphor-certificate-manager',
86 'mainapp.cpp',
87 dependencies: cert_manager_dep,
88 install: true,
89)
90
91if not get_option('ca-cert-extension').disabled()
92 subdir('bmc-vmi-ca')
93endif
94
95subdir('dist')
96
97if not get_option('tests').disabled()
98 subdir('test')
99endif
100