1project('debug-trigger', 'c', 2 license: 'Apache-2.0', 3 version: '0.1', 4 default_options: [ 5 'warning_level=3', 6 'werror=true', 7 'c_std=gnu18', 8 ]) 9 10config = configuration_data() 11debug_trigger_deps = [] 12 13if get_option('systemd') 14 systemd = dependency('systemd') 15 unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') 16 configure_file(input: 'systemd/system/debug-trigger@.service', 17 output: 'debug-trigger@.service', 18 copy: true, 19 install_dir: unitdir) 20 debug_trigger_deps += dependency('libsystemd') 21endif 22 23config.set10('HAVE_SYSTEMD', get_option('systemd')) 24config_h = configure_file(configuration: config, output: 'config.h') 25 26udev = dependency('udev') 27udevdir = udev.get_pkgconfig_variable('udevdir') 28 29triggers = get_option('triggers') 30foreach trigger : triggers 31 src = 'udev/rules.d/debug-trigger-' + trigger + '.rules' 32 dst = 'debug-trigger-' + trigger + '.rules' 33 rulesdir = udevdir + '/rules.d' 34 configure_file(input: src, output: dst, copy: true, install_dir: rulesdir) 35endforeach 36 37executable('debug-trigger', 'main.c', config_h, 38 dependencies: debug_trigger_deps, 39 install: true) 40