1*366546cfSJonathan Doman# Map of unit file to meson option which controls whether file gets installed 2*366546cfSJonathan Domanunit_files = [ 3*366546cfSJonathan Doman ['smbios-mdrv2.service', ''], 4*366546cfSJonathan Doman ['xyz.openbmc_project.cpuinfo.service', 'cpuinfo'], 5*366546cfSJonathan Doman] 6*366546cfSJonathan Doman 7*366546cfSJonathan Domansystemd_dep = dependency('systemd') 8*366546cfSJonathan Domansystemd_system_unitdir = systemd_dep.get_variable( 9*366546cfSJonathan Doman 'systemd_system_unit_dir', 10*366546cfSJonathan Doman pkgconfig_define: ['rootprefix', get_option('prefix')] 11*366546cfSJonathan Doman ) 12*366546cfSJonathan Doman 13*366546cfSJonathan Domanforeach u : unit_files 14*366546cfSJonathan Doman if u[1] == '' or get_option(u[1]).allowed() 15*366546cfSJonathan Doman install_data(u[0], install_dir: systemd_system_unitdir) 16*366546cfSJonathan Doman endif 17*366546cfSJonathan Domanendforeach 18