xref: /openbmc/witherspoon-pfault-analysis/meson.build (revision 91be17054838fdc8775bfa298d4d582c701e250e)
1project(
2    'witherspoon-pfault-analysis',
3    'cpp',
4    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
5    license: 'Apache-2.0',
6    version: '1.0',
7    meson_version: '>=1.1.1',
8)
9
10build_tests = get_option('tests')
11
12gmock = dependency('gmock', disabler: true, required: build_tests)
13gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
14phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
15phosphor_logging = dependency('phosphor-logging')
16prog_python = import('python').find_installation('python3')
17sdbusplus = dependency('sdbusplus')
18sdbuspp = find_program('sdbus++')
19sdeventplus = dependency('sdeventplus')
20
21conf = configuration_data()
22conf.set_quoted(
23    'INPUT_HISTORY_BUSNAME_ROOT',
24    get_option('input-history-busname-root'),
25)
26conf.set_quoted(
27    'INPUT_HISTORY_SENSOR_ROOT',
28    get_option('input-history-sensor-root'),
29)
30conf.set10('UCD90160_DEVICE_ACCESS', get_option('ucd90160-access'))
31
32configure_file(output: 'config.h', configuration: conf)
33
34# Ensure the generated header here winds up in the correct path in the build
35# tree such that it actually get used and doesn't get found in the sysroot
36# somewhere.  Meson doesn't allow path elements (rightfully so) when specifying
37# the output filename of a target definition so the target must be defined in
38# the directory where the artifacts need to be placed.  Do that now, because
39# the generated source (cpp) is needed to define the library target.
40subdir('org/open_power/Witherspoon/Fault')
41
42libpower = static_library(
43    'power',
44    error_cpp,
45    error_hpp,
46    'gpio.cpp',
47    'pmbus.cpp',
48    'utility.cpp',
49    dependencies: [
50        phosphor_dbus_interfaces,
51        phosphor_logging,
52        sdbusplus,
53        sdeventplus,
54    ],
55)
56
57subdir('power-sequencer')
58subdir('power-supply')
59subdir('test')
60