blob: e2a337f38480a1cf152570fc54ee1c90c4686eb8 [file] [log] [blame]
Patrick Williamsbb939ea2021-12-03 15:41:02 -06001project(
2 'phosphor-certificate-manager',
3 'cpp',
4 default_options: [
5 'buildtype=debugoptimized',
6 'cpp_std=c++20',
7 'warning_level=3',
8 'werror=true',
9 ],
10 meson_version: '>=0.57.0',
11)
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
45configure_file(
Patrick Williamse0e2cce2021-12-13 08:40:50 -060046 input: 'config.h.in',
Patrick Williamsbb939ea2021-12-03 15:41:02 -060047 output: 'config.h',
48 configuration: config_data
49)
50
51phosphor_certificate_deps = [
52 openssl_dep,
53 phosphor_dbus_interfaces_dep,
54 phosphor_logging_dep,
55 sdbusplus_dep,
56 sdeventplus_dep,
Nan Zhou7047be62022-03-10 12:34:06 -080057 cli11_dep,
Patrick Williamsbb939ea2021-12-03 15:41:02 -060058]
59
60cert_manager_lib = static_library(
61 'phosphor-certificate-manager',
62 [
63 'argument.cpp',
64 'certificate.cpp',
65 'certs_manager.cpp',
66 'csr.cpp',
67 'watch.cpp',
Nan Zhoue869bb62021-12-30 11:34:42 -080068 'x509_utils.cpp',
Patrick Williamsbb939ea2021-12-03 15:41:02 -060069 ],
70 dependencies: phosphor_certificate_deps,
71)
72
73cert_manager_dep = declare_dependency(
74 link_with: cert_manager_lib,
75 dependencies: phosphor_certificate_deps
76)
77
78executable(
79 'phosphor-certificate-manager',
80 'mainapp.cpp',
81 dependencies: cert_manager_dep,
82 install: true,
83)
84
85if not get_option('ca-cert-extension').disabled()
86 subdir('bmc-vmi-ca')
87endif
88
89subdir('dist')
90
91if not get_option('tests').disabled()
92 subdir('test')
93endif
94