blob: 36089a1f30f9fca65421c2ce5fe5a223c415d8bb [file] [log] [blame]
George Liuc7d70b62021-05-17 16:02:18 +08001project(
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
George Liu3c894262021-12-28 10:32:49 +080013sdbusplus_dep = dependency('sdbusplus')
14phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
Andrew Jefferyebc30b72023-02-06 14:19:16 +103015boost = dependency('boost', include_type: 'system')
George Liuc7d70b62021-05-17 16:02:18 +080016deps = [
17 sdbusplus_dep,
18 phosphor_dbus_interfaces_dep,
Andrew Jefferyebc30b72023-02-06 14:19:16 +103019 boost,
George Liuc7d70b62021-05-17 16:02:18 +080020]
21
Jayashree Dhanapal3930b6b2022-09-20 17:08:15 +053022udevdir = dependency('udev').get_variable(pkgconfig: 'udevdir')
23install_data(['70-leds.rules'], install_dir : udevdir / 'rules.d')
24
25systemd = dependency('systemd')
26install_data(
27 ['xyz.openbmc_project.led.controller@.service'],
28 install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
29)
30
George Liuc7d70b62021-05-17 16:02:18 +080031sources = [
32 'argument.cpp',
33 'controller.cpp',
34 'physical.cpp',
35 'sysfs.cpp',
36]
37
38executable(
39 'phosphor-ledcontroller',
40 sources,
41 implicit_include_directories: true,
42 dependencies: deps,
43 install: true,
Jayashree Dhanapal3930b6b2022-09-20 17:08:15 +053044 install_dir: '/usr/libexec/phosphor-led-sysfs'
George Liuc7d70b62021-05-17 16:02:18 +080045)
46
47build_tests = get_option('tests')
48if build_tests.enabled()
49 subdir('test')
50endif