Jonathan Doman | 366546c | 2023-07-24 12:33:16 -0700 | [diff] [blame] | 1 | # Map of unit file to meson option which controls whether file gets installed |
| 2 | unit_files = [ |
| 3 | ['smbios-mdrv2.service', ''], |
| 4 | ['xyz.openbmc_project.cpuinfo.service', 'cpuinfo'], |
| 5 | ] |
| 6 | |
| 7 | systemd_dep = dependency('systemd') |
| 8 | systemd_system_unitdir = systemd_dep.get_variable( |
| 9 | 'systemd_system_unit_dir', |
| 10 | pkgconfig_define: ['rootprefix', get_option('prefix')] |
| 11 | ) |
| 12 | |
| 13 | foreach u : unit_files |
| 14 | if u[1] == '' or get_option(u[1]).allowed() |
| 15 | install_data(u[0], install_dir: systemd_system_unitdir) |
| 16 | endif |
| 17 | endforeach |