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