blob: 79f485020c6dc013a4d531e75059543de9a7d749 [file] [log] [blame]
Brad Bishop39b370a2019-09-02 02:37:32 -04001project(
2 'witherspoon-pfault-analysis',
3 'cpp',
4 default_options: [
5 'warning_level=3',
6 'werror=true',
Patrick Williams008e82f2021-10-06 15:48:12 -05007 'cpp_std=c++20'
Brad Bishop39b370a2019-09-02 02:37:32 -04008 ],
9 license: 'Apache-2.0',
10 version: '1.0',
Patrick Williams008e82f2021-10-06 15:48:12 -050011 meson_version: '>=0.57.0',
Brad Bishop39b370a2019-09-02 02:37:32 -040012)
13
14build_tests = get_option('tests')
15
16cppfs = meson.get_compiler('cpp').find_library('stdc++fs')
17gmock = dependency('gmock', disabler: true, required: build_tests)
18gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
Brad Bishop39b370a2019-09-02 02:37:32 -040019phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
20phosphor_logging = dependency('phosphor-logging')
Patrick Williamsf29a6f12020-05-13 12:06:23 -050021prog_python = import('python').find_installation('python3')
Brad Bishop39b370a2019-09-02 02:37:32 -040022sdbusplus = 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.set10(
32 'UCD90160_DEVICE_ACCESS', get_option('ucd90160-access'))
33
34configure_file(output: 'config.h', configuration: conf)
35
36# Ensure the generated header here winds up in the correct path in the build
37# tree such that it actually get used and doesn't get found in the sysroot
38# somewhere. Meson doesn't allow path elements (rightfully so) when specifying
39# the output filename of a target definition so the target must be defined in
40# the directory where the artifacts need to be placed. Do that now, because
41# the generated source (cpp) is needed to define the library target.
42subdir('org/open_power/Witherspoon/Fault')
43
44libpower = static_library(
45 'power',
46 error_cpp,
47 error_hpp,
48 'gpio.cpp',
49 'pmbus.cpp',
50 'utility.cpp',
51 dependencies: [
52 cppfs,
Brad Bishop39b370a2019-09-02 02:37:32 -040053 phosphor_dbus_interfaces,
54 phosphor_logging,
55 sdbusplus,
56 sdeventplus,
57 ],
58)
59
60subdir('power-sequencer')
61subdir('power-supply')
62subdir('test')