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