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