George Liu | c7d70b6 | 2021-05-17 16:02:18 +0800 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-ledcontroller', 'cpp', |
| 3 | version : '1.0.0', |
| 4 | meson_version: '>=0.57.0', |
| 5 | default_options: [ |
| 6 | 'warning_level=3', |
| 7 | 'werror=true', |
| 8 | 'cpp_std=c++20', |
| 9 | 'buildtype=debugoptimized' |
| 10 | ] |
| 11 | ) |
| 12 | |
| 13 | sdbusplus_dep = dependency( |
| 14 | 'sdbusplus', |
| 15 | fallback: [ |
| 16 | 'sdbusplus', |
| 17 | 'sdbusplus_dep' |
| 18 | ], |
| 19 | ) |
| 20 | phosphor_dbus_interfaces_dep = dependency( |
| 21 | 'phosphor-dbus-interfaces', |
| 22 | fallback: [ |
| 23 | 'phosphor-dbus-interfaces', |
| 24 | 'phosphor_dbus_interfaces_dep' |
| 25 | ], |
| 26 | ) |
| 27 | |
| 28 | deps = [ |
| 29 | sdbusplus_dep, |
| 30 | phosphor_dbus_interfaces_dep, |
| 31 | ] |
| 32 | |
| 33 | sources = [ |
| 34 | 'argument.cpp', |
| 35 | 'controller.cpp', |
| 36 | 'physical.cpp', |
| 37 | 'sysfs.cpp', |
| 38 | ] |
| 39 | |
| 40 | executable( |
| 41 | 'phosphor-ledcontroller', |
| 42 | sources, |
| 43 | implicit_include_directories: true, |
| 44 | dependencies: deps, |
| 45 | install: true, |
| 46 | install_dir: '/usr/sbin' |
| 47 | ) |
| 48 | |
| 49 | build_tests = get_option('tests') |
| 50 | if build_tests.enabled() |
| 51 | subdir('test') |
| 52 | endif |