Patrick Williams | bb939ea | 2021-12-03 15:41:02 -0600 | [diff] [blame] | 1 | project( |
| 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 | |
| 13 | cpp = meson.get_compiler('cpp') |
| 14 | |
| 15 | sdbusplus_dep = dependency( |
| 16 | 'sdbusplus', |
| 17 | fallback: ['sdbusplus', 'sdbusplus_dep'], |
| 18 | ) |
| 19 | |
| 20 | sdeventplus_dep = dependency( |
| 21 | 'sdeventplus', |
| 22 | fallback: ['sdeventplus', 'sdeventplus_dep'], |
| 23 | ) |
| 24 | |
| 25 | phosphor_dbus_interfaces_dep = dependency( |
| 26 | 'phosphor-dbus-interfaces', |
| 27 | fallback: [ |
| 28 | 'phosphor-dbus-interfaces', |
| 29 | 'phosphor_dbus_interfaces_dep' |
| 30 | ], |
| 31 | ) |
| 32 | |
| 33 | phosphor_logging_dep = dependency( |
| 34 | 'phosphor-logging', |
| 35 | fallback: ['phosphor-logging', 'phosphor_logging_dep'], |
| 36 | ) |
| 37 | |
| 38 | systemd_dep = dependency('systemd') |
| 39 | openssl_dep = dependency('openssl') |
| 40 | |
| 41 | config_data = configuration_data() |
| 42 | config_data.set( |
| 43 | 'authority_limit', |
| 44 | get_option('authority-limit') |
| 45 | ) |
| 46 | |
| 47 | configure_file( |
Patrick Williams | e0e2cce | 2021-12-13 08:40:50 -0600 | [diff] [blame^] | 48 | input: 'config.h.in', |
Patrick Williams | bb939ea | 2021-12-03 15:41:02 -0600 | [diff] [blame] | 49 | output: 'config.h', |
| 50 | configuration: config_data |
| 51 | ) |
| 52 | |
| 53 | phosphor_certificate_deps = [ |
| 54 | openssl_dep, |
| 55 | phosphor_dbus_interfaces_dep, |
| 56 | phosphor_logging_dep, |
| 57 | sdbusplus_dep, |
| 58 | sdeventplus_dep, |
| 59 | ] |
| 60 | |
| 61 | cert_manager_lib = static_library( |
| 62 | 'phosphor-certificate-manager', |
| 63 | [ |
| 64 | 'argument.cpp', |
| 65 | 'certificate.cpp', |
| 66 | 'certs_manager.cpp', |
| 67 | 'csr.cpp', |
| 68 | 'watch.cpp', |
| 69 | ], |
| 70 | dependencies: phosphor_certificate_deps, |
| 71 | ) |
| 72 | |
| 73 | cert_manager_dep = declare_dependency( |
| 74 | link_with: cert_manager_lib, |
| 75 | dependencies: phosphor_certificate_deps |
| 76 | ) |
| 77 | |
| 78 | executable( |
| 79 | 'phosphor-certificate-manager', |
| 80 | 'mainapp.cpp', |
| 81 | dependencies: cert_manager_dep, |
| 82 | install: true, |
| 83 | ) |
| 84 | |
| 85 | if not get_option('ca-cert-extension').disabled() |
| 86 | subdir('bmc-vmi-ca') |
| 87 | endif |
| 88 | |
| 89 | subdir('dist') |
| 90 | |
| 91 | if not get_option('tests').disabled() |
| 92 | subdir('test') |
| 93 | endif |
| 94 | |