Andrew Jeffery | 11cd254 | 2021-05-03 11:03:30 +0930 | [diff] [blame] | 1 | project('debug-trigger', 'c', license: 'Apache-2.0', version: '0.1') |
| 2 | executable('debug-trigger', 'main.c', install: true) |
| 3 | |
| 4 | if get_option('systemd') |
| 5 | systemd = dependency('systemd') |
| 6 | unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') |
| 7 | configure_file(input: 'systemd/system/debug-trigger@.service', |
| 8 | output: 'debug-trigger@.service', |
| 9 | copy: true, |
| 10 | install_dir: unitdir) |
| 11 | endif |
| 12 | |
| 13 | udev = dependency('udev') |
| 14 | udevdir = udev.get_pkgconfig_variable('udevdir') |
| 15 | udevrules = [ |
Andrew Jeffery | 2001715 | 2021-06-10 11:16:58 +0930 | [diff] [blame^] | 16 | 'debug-trigger-kcs1', |
| 17 | 'debug-trigger-kcs2', |
| 18 | 'debug-trigger-kcs3', |
| 19 | 'debug-trigger-kcs4', |
Andrew Jeffery | 11cd254 | 2021-05-03 11:03:30 +0930 | [diff] [blame] | 20 | ] |
| 21 | |
Andrew Jeffery | 2001715 | 2021-06-10 11:16:58 +0930 | [diff] [blame^] | 22 | triggers = get_option('triggers') |
| 23 | foreach trigger : triggers |
| 24 | src = 'udev/rules.d/debug-trigger-' + trigger + '.rules' |
| 25 | dst = 'debug-trigger-' + trigger + '.rules' |
| 26 | rulesdir = udevdir + '/rules.d' |
| 27 | configure_file(input: src, output: dst, copy: true, install_dir: rulesdir) |
Andrew Jeffery | 11cd254 | 2021-05-03 11:03:30 +0930 | [diff] [blame] | 28 | endforeach |