George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-ledcontroller', 'cpp', |
| 3 | version : '1.0.0', |
Patrick Williams | 3778f8e | 2023-04-12 08:01:18 -0500 | [diff] [blame] | 4 | meson_version: '>=0.58.0', |
George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 5 | default_options: [ |
| 6 | 'warning_level=3', |
| 7 | 'werror=true', |
| 8 | 'cpp_std=c++20', |
| 9 | 'buildtype=debugoptimized' |
| 10 | ] |
| 11 | ) |
| 12 | |
George Liu | 3c89426 | 2021-12-28 10:32:49 +0800 | [diff] [blame] | 13 | sdbusplus_dep = dependency('sdbusplus') |
| 14 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
Andrew Jeffery | ebc30b7 | 2023-02-06 14:19:16 +1030 | [diff] [blame] | 15 | boost = dependency('boost', include_type: 'system') |
George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 16 | deps = [ |
| 17 | sdbusplus_dep, |
| 18 | phosphor_dbus_interfaces_dep, |
Andrew Jeffery | ebc30b7 | 2023-02-06 14:19:16 +1030 | [diff] [blame] | 19 | boost, |
George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 20 | ] |
| 21 | |
Patrick Williams | 3778f8e | 2023-04-12 08:01:18 -0500 | [diff] [blame] | 22 | udevdir = dependency('udev').get_variable('udevdir') |
Andrew Jeffery | d32dd3f | 2023-02-03 11:11:04 +1030 | [diff] [blame] | 23 | install_data(['udev' / 'rules.d' / '70-leds.rules'], install_dir : udevdir / 'rules.d') |
Jayashree Dhanapal | 3930b6b | 2022-09-20 17:08:15 +0530 | [diff] [blame] | 24 | |
| 25 | systemd = dependency('systemd') |
Andrew Jeffery | 97ca787 | 2023-02-07 10:52:42 +1030 | [diff] [blame] | 26 | install_data(['systemd' / 'system' / 'xyz.openbmc_project.led.controller@.service'], |
Patrick Williams | 3778f8e | 2023-04-12 08:01:18 -0500 | [diff] [blame] | 27 | install_dir: systemd.get_variable('systemdsystemunitdir') |
Jayashree Dhanapal | 3930b6b | 2022-09-20 17:08:15 +0530 | [diff] [blame] | 28 | ) |
| 29 | |
George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 30 | sources = [ |
| 31 | 'argument.cpp', |
| 32 | 'controller.cpp', |
| 33 | 'physical.cpp', |
| 34 | 'sysfs.cpp', |
| 35 | ] |
| 36 | |
| 37 | executable( |
| 38 | 'phosphor-ledcontroller', |
| 39 | sources, |
| 40 | implicit_include_directories: true, |
| 41 | dependencies: deps, |
| 42 | install: true, |
Jayashree Dhanapal | 3930b6b | 2022-09-20 17:08:15 +0530 | [diff] [blame] | 43 | install_dir: '/usr/libexec/phosphor-led-sysfs' |
George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 44 | ) |
| 45 | |
| 46 | build_tests = get_option('tests') |
| 47 | if build_tests.enabled() |
| 48 | subdir('test') |
| 49 | endif |