blob: c826d00a37f797e6391fae7fd5baec79fee37425 [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')
George Liuc7d70b62021-05-17 16:02:18 +080015
16deps = [
17 sdbusplus_dep,
18 phosphor_dbus_interfaces_dep,
19]
20
Jayashree Dhanapal3930b6b2022-09-20 17:08:15 +053021udevdir = dependency('udev').get_variable(pkgconfig: 'udevdir')
22install_data(['70-leds.rules'], install_dir : udevdir / 'rules.d')
23
24systemd = dependency('systemd')
25install_data(
26 ['xyz.openbmc_project.led.controller@.service'],
27 install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
28)
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