xref: /openbmc/phosphor-fan-presence/control/meson.build (revision ef17a25a2d65b3577a1e5b99cdca645a226eb1f7)
1a081956fSMike Capps
2a081956fSMike Cappsinclude_dirs=[
3a081956fSMike Capps    '.',
4a081956fSMike Capps    '..'
5a081956fSMike Capps]
6a081956fSMike Capps
7a081956fSMike Cappsdeps=[
8a081956fSMike Capps    phosphor_dbus_interfaces_dep,
9a081956fSMike Capps    phosphor_logging_dep,
10a081956fSMike Capps    sdbusplus_dep,
111a56c2bcSPatrick Williams    sdeventplus_dep,
121a56c2bcSPatrick Williams    cereal_dep,
13a081956fSMike Capps]
14a081956fSMike Capps
15a081956fSMike Cappssources = ['main.cpp']
16a081956fSMike Capps
17a081956fSMike Cappsif conf.has('CONTROL_USE_JSON')
18*ef17a25aSPatrick Williams    deps += nlohmann_json_dep
19a081956fSMike Capps    include_dirs += [
20a081956fSMike Capps        './json',
21a081956fSMike Capps        './json/actions',
22a081956fSMike Capps        './json/triggers'
23a081956fSMike Capps    ]
24a081956fSMike Capps    sources += [
25a081956fSMike Capps        'json/dbus_zone.cpp',
26a081956fSMike Capps        'json/event.cpp',
27a081956fSMike Capps        'json/fan.cpp',
28a081956fSMike Capps        'json/group.cpp',
29a081956fSMike Capps        'json/manager.cpp',
30a081956fSMike Capps        'json/profile.cpp',
31a081956fSMike Capps        'json/zone.cpp',
32a081956fSMike Capps        'json/actions/count_state_floor.cpp',
33a081956fSMike Capps        'json/actions/count_state_target.cpp',
34a081956fSMike Capps        'json/actions/default_floor.cpp',
35a081956fSMike Capps        'json/actions/get_managed_objects.cpp',
36a081956fSMike Capps        'json/actions/mapped_floor.cpp',
37a081956fSMike Capps        'json/actions/missing_owner_target.cpp',
38a081956fSMike Capps        'json/actions/net_target_decrease.cpp',
39a081956fSMike Capps        'json/actions/net_target_increase.cpp',
40a081956fSMike Capps        'json/actions/override_fan_target.cpp',
41a081956fSMike Capps        'json/actions/pcie_card_floors.cpp',
42a081956fSMike Capps        'json/actions/request_target_base.cpp',
43a081956fSMike Capps        'json/actions/set_parameter_from_group_max.cpp',
44bb29bb7cSchaul.ampere        'json/actions/target_from_group_max.cpp',
45a081956fSMike Capps        'json/actions/timer_based_actions.cpp',
46a081956fSMike Capps        'json/utils/flight_recorder.cpp',
47a081956fSMike Capps        'json/utils/modifier.cpp',
48a081956fSMike Capps        'json/utils/pcie_card_metadata.cpp',
49a081956fSMike Capps        'json/triggers/init.cpp',
50a081956fSMike Capps        'json/triggers/parameter.cpp',
51a081956fSMike Capps        'json/triggers/signal.cpp',
52a081956fSMike Capps        'json/triggers/timer.cpp'
53a081956fSMike Capps    ]
54a081956fSMike Cappselse
55a081956fSMike Capps    fan_zone_defs_cpp_dep = custom_target(
56a081956fSMike Capps        'fan_zone_defs.cpp',
57a081956fSMike Capps        input: files(
58a081956fSMike Capps            './gen-fan-zone-defs.py',
59a081956fSMike Capps            conf.get_unquoted('FAN_DEF_YAML_FILE'),
60a081956fSMike Capps            conf.get_unquoted('FAN_ZONE_YAML_FILE'),
61a081956fSMike Capps            conf.get_unquoted('ZONE_EVENTS_YAML_FILE'),
62a081956fSMike Capps            conf.get_unquoted('ZONE_CONDITIONS_YAML_FILE')
63a081956fSMike Capps        ),
64a081956fSMike Capps        command: [
65a081956fSMike Capps            python_prog, '@INPUT0@',
66a081956fSMike Capps            '-f','@INPUT1@',
67a081956fSMike Capps            '-z','@INPUT2@',
68a081956fSMike Capps            '-e','@INPUT3@',
69a081956fSMike Capps            '-c','@INPUT4@',
70a081956fSMike Capps            '-o', 'control'
71a081956fSMike Capps        ],
72a081956fSMike Capps        output: 'fan_zone_defs.cpp'
73a081956fSMike Capps    )
74a081956fSMike Capps
75a081956fSMike Capps    sources += [
76a081956fSMike Capps        'actions.cpp',
77a081956fSMike Capps        'fan.cpp',
78a081956fSMike Capps        fan_zone_defs_cpp_dep,
79a081956fSMike Capps        'manager.cpp',
80a081956fSMike Capps        'preconditions.cpp',
81a081956fSMike Capps        'triggers.cpp',
82a081956fSMike Capps        'utility.cpp',
83a081956fSMike Capps        'zone.cpp'
84a081956fSMike Capps    ]
85a081956fSMike Capps
86a081956fSMike Cappsendif
87a081956fSMike Capps
88a081956fSMike Cappsphosphor_fan_control_include_directories = include_directories(include_dirs)
89a081956fSMike Cappsphosphor_fan_control = executable(
90a081956fSMike Capps    'phosphor-fan-control',
91a081956fSMike Capps    sources,
92a081956fSMike Capps    dependencies:deps,
93a081956fSMike Capps    implicit_include_directories: false,
94a081956fSMike Capps    include_directories: phosphor_fan_control_include_directories,
95a081956fSMike Capps    install: true
96a081956fSMike Capps)
97a081956fSMike Capps
98a081956fSMike Cappsfanctl = executable(
99a081956fSMike Capps  'fanctl',
100a081956fSMike Capps  'fanctl.cpp',
101a081956fSMike Capps      dependencies: [
102a081956fSMike Capps          cli11_dep,
103*ef17a25aSPatrick Williams          nlohmann_json_dep,
104fc4be0d6SPatrick Williams          phosphor_logging_dep,
10516e512d4SPatrick Williams          sdbusplus_dep,
106a081956fSMike Capps      ],
107a081956fSMike Capps  include_directories: phosphor_fan_control_include_directories,
108a081956fSMike Capps  install: true
109a081956fSMike Capps)
110