Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 1 | project( |
| 2 | 'witherspoon-pfault-analysis', |
| 3 | 'cpp', |
Patrick Williams | 91be170 | 2025-02-01 08:37:05 -0500 | [diff] [blame^] | 4 | default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'], |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 5 | license: 'Apache-2.0', |
| 6 | version: '1.0', |
Patrick Williams | b1dc2b2 | 2023-07-12 11:15:31 -0500 | [diff] [blame] | 7 | meson_version: '>=1.1.1', |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | build_tests = get_option('tests') |
| 11 | |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 12 | gmock = dependency('gmock', disabler: true, required: build_tests) |
| 13 | gtest = dependency('gtest', main: true, disabler: true, required: build_tests) |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 14 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 15 | phosphor_logging = dependency('phosphor-logging') |
Patrick Williams | f29a6f1 | 2020-05-13 12:06:23 -0500 | [diff] [blame] | 16 | prog_python = import('python').find_installation('python3') |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 17 | sdbusplus = dependency('sdbusplus') |
| 18 | sdbuspp = find_program('sdbus++') |
| 19 | sdeventplus = dependency('sdeventplus') |
| 20 | |
| 21 | conf = configuration_data() |
| 22 | conf.set_quoted( |
Patrick Williams | 91be170 | 2025-02-01 08:37:05 -0500 | [diff] [blame^] | 23 | 'INPUT_HISTORY_BUSNAME_ROOT', |
| 24 | get_option('input-history-busname-root'), |
| 25 | ) |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 26 | conf.set_quoted( |
Patrick Williams | 91be170 | 2025-02-01 08:37:05 -0500 | [diff] [blame^] | 27 | 'INPUT_HISTORY_SENSOR_ROOT', |
| 28 | get_option('input-history-sensor-root'), |
| 29 | ) |
| 30 | conf.set10('UCD90160_DEVICE_ACCESS', get_option('ucd90160-access')) |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 31 | |
| 32 | configure_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. |
| 40 | subdir('org/open_power/Witherspoon/Fault') |
| 41 | |
| 42 | libpower = static_library( |
| 43 | 'power', |
| 44 | error_cpp, |
| 45 | error_hpp, |
| 46 | 'gpio.cpp', |
| 47 | 'pmbus.cpp', |
| 48 | 'utility.cpp', |
| 49 | dependencies: [ |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 50 | phosphor_dbus_interfaces, |
| 51 | phosphor_logging, |
| 52 | sdbusplus, |
| 53 | sdeventplus, |
| 54 | ], |
| 55 | ) |
| 56 | |
| 57 | subdir('power-sequencer') |
| 58 | subdir('power-supply') |
| 59 | subdir('test') |