blob: 0ae858498d097c54debc2002f6449f7da1e4c695 [file] [log] [blame]
George Liuc7d70b62021-05-17 16:02:18 +08001project(
2 'phosphor-ledcontroller', 'cpp',
3 version : '1.0.0',
Patrick Williams3778f8e2023-04-12 08:01:18 -05004 meson_version: '>=0.58.0',
George Liuc7d70b62021-05-17 16:02:18 +08005 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
Patrick Williams3778f8e2023-04-12 08:01:18 -050022udevdir = dependency('udev').get_variable('udevdir')
Andrew Jefferyd32dd3f2023-02-03 11:11:04 +103023install_data(['udev' / 'rules.d' / '70-leds.rules'], install_dir : udevdir / 'rules.d')
Jayashree Dhanapal3930b6b2022-09-20 17:08:15 +053024
25systemd = dependency('systemd')
Andrew Jeffery97ca7872023-02-07 10:52:42 +103026install_data(['systemd' / 'system' / 'xyz.openbmc_project.led.controller@.service'],
Patrick Williams3778f8e2023-04-12 08:01:18 -050027 install_dir: systemd.get_variable('systemdsystemunitdir')
Jayashree Dhanapal3930b6b2022-09-20 17:08:15 +053028)
29
George Liuc7d70b62021-05-17 16:02:18 +080030sources = [
31 'argument.cpp',
32 'controller.cpp',
33 'physical.cpp',
34 'sysfs.cpp',
35]
36
37executable(
38 'phosphor-ledcontroller',
39 sources,
40 implicit_include_directories: true,
41 dependencies: deps,
42 install: true,
Jayashree Dhanapal3930b6b2022-09-20 17:08:15 +053043 install_dir: '/usr/libexec/phosphor-led-sysfs'
George Liuc7d70b62021-05-17 16:02:18 +080044)
45
46build_tests = get_option('tests')
47if build_tests.enabled()
48 subdir('test')
49endif