Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 1 | project( |
| 2 | 'witherspoon-pfault-analysis', |
| 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 | |
| 13 | build_tests = get_option('tests') |
| 14 | |
| 15 | cppfs = meson.get_compiler('cpp').find_library('stdc++fs') |
| 16 | gmock = dependency('gmock', disabler: true, required: build_tests) |
| 17 | gtest = dependency('gtest', main: true, disabler: true, required: build_tests) |
| 18 | openpower_dbus_interfaces = dependency('openpower-dbus-interfaces') |
| 19 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 20 | phosphor_logging = dependency('phosphor-logging') |
Patrick Williams | f29a6f1 | 2020-05-13 12:06:23 -0500 | [diff] [blame] | 21 | prog_python = import('python').find_installation('python3') |
Brad Bishop | 39b370a | 2019-09-02 02:37:32 -0400 | [diff] [blame] | 22 | sdbusplus = dependency('sdbusplus') |
| 23 | sdbuspp = find_program('sdbus++') |
| 24 | sdeventplus = dependency('sdeventplus') |
| 25 | |
| 26 | conf = configuration_data() |
| 27 | conf.set_quoted( |
| 28 | 'INPUT_HISTORY_BUSNAME_ROOT', get_option('input-history-busname-root')) |
| 29 | conf.set_quoted( |
| 30 | 'INPUT_HISTORY_SENSOR_ROOT', get_option('input-history-sensor-root')) |
| 31 | conf.set10( |
| 32 | 'UCD90160_DEVICE_ACCESS', get_option('ucd90160-access')) |
| 33 | |
| 34 | configure_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. |
| 42 | subdir('org/open_power/Witherspoon/Fault') |
| 43 | |
| 44 | libpower = static_library( |
| 45 | 'power', |
| 46 | error_cpp, |
| 47 | error_hpp, |
| 48 | 'gpio.cpp', |
| 49 | 'pmbus.cpp', |
| 50 | 'utility.cpp', |
| 51 | dependencies: [ |
| 52 | cppfs, |
| 53 | openpower_dbus_interfaces, |
| 54 | phosphor_dbus_interfaces, |
| 55 | phosphor_logging, |
| 56 | sdbusplus, |
| 57 | sdeventplus, |
| 58 | ], |
| 59 | ) |
| 60 | |
| 61 | subdir('power-sequencer') |
| 62 | subdir('power-supply') |
| 63 | subdir('test') |