blob: 6aa81431071887025fdabc735bb63cc92636ea58 [file] [log] [blame]
Mike Cappsa0819562022-06-13 10:17:10 -04001
2include_dirs=[
3 '.',
4 '..'
5]
6
7deps=[
8 phosphor_dbus_interfaces_dep,
9 phosphor_logging_dep,
10 sdbusplus_dep,
Patrick Williams1a56c2b2023-07-17 12:07:23 -050011 sdeventplus_dep,
12 cereal_dep,
Mike Cappsa0819562022-06-13 10:17:10 -040013]
14
15sources = ['main.cpp']
16
17if conf.has('CONTROL_USE_JSON')
Patrick Williamsef17a252023-12-07 14:53:06 -060018 deps += nlohmann_json_dep
Mike Cappsa0819562022-06-13 10:17:10 -040019 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',
chaul.amperebb29bb72022-08-11 08:01:05 +000044 'json/actions/target_from_group_max.cpp',
Mike Cappsa0819562022-06-13 10:17:10 -040045 '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',
Mike Cappsa0819562022-06-13 10:17:10 -040077 'fan.cpp',
78 fan_zone_defs_cpp_dep,
79 'manager.cpp',
80 'preconditions.cpp',
81 'triggers.cpp',
82 'utility.cpp',
83 'zone.cpp'
84 ]
85
86endif
87
88phosphor_fan_control_include_directories = include_directories(include_dirs)
89phosphor_fan_control = executable(
90 'phosphor-fan-control',
91 sources,
92 dependencies:deps,
93 implicit_include_directories: false,
94 include_directories: phosphor_fan_control_include_directories,
95 install: true
96)
97
98fanctl = executable(
99 'fanctl',
100 'fanctl.cpp',
101 dependencies: [
102 cli11_dep,
Patrick Williamsef17a252023-12-07 14:53:06 -0600103 nlohmann_json_dep,
Patrick Williamsfc4be0d2023-07-17 12:18:53 -0500104 phosphor_logging_dep,
Patrick Williams16e512d2023-07-17 12:14:25 -0500105 sdbusplus_dep,
Mike Cappsa0819562022-06-13 10:17:10 -0400106 ],
107 include_directories: phosphor_fan_control_include_directories,
108 install: true
109)