xref: /openbmc/witherspoon-pfault-analysis/meson.build (revision 91be17054838fdc8775bfa298d4d582c701e250e)
139b370a5SBrad Bishopproject(
239b370a5SBrad Bishop    'witherspoon-pfault-analysis',
339b370a5SBrad Bishop    'cpp',
4*91be1705SPatrick Williams    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
539b370a5SBrad Bishop    license: 'Apache-2.0',
639b370a5SBrad Bishop    version: '1.0',
7b1dc2b21SPatrick Williams    meson_version: '>=1.1.1',
839b370a5SBrad Bishop)
939b370a5SBrad Bishop
1039b370a5SBrad Bishopbuild_tests = get_option('tests')
1139b370a5SBrad Bishop
1239b370a5SBrad Bishopgmock = dependency('gmock', disabler: true, required: build_tests)
1339b370a5SBrad Bishopgtest = dependency('gtest', main: true, disabler: true, required: build_tests)
1439b370a5SBrad Bishopphosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
1539b370a5SBrad Bishopphosphor_logging = dependency('phosphor-logging')
16f29a6f1aSPatrick Williamsprog_python = import('python').find_installation('python3')
1739b370a5SBrad Bishopsdbusplus = dependency('sdbusplus')
1839b370a5SBrad Bishopsdbuspp = find_program('sdbus++')
1939b370a5SBrad Bishopsdeventplus = dependency('sdeventplus')
2039b370a5SBrad Bishop
2139b370a5SBrad Bishopconf = configuration_data()
2239b370a5SBrad Bishopconf.set_quoted(
23*91be1705SPatrick Williams    'INPUT_HISTORY_BUSNAME_ROOT',
24*91be1705SPatrick Williams    get_option('input-history-busname-root'),
25*91be1705SPatrick Williams)
2639b370a5SBrad Bishopconf.set_quoted(
27*91be1705SPatrick Williams    'INPUT_HISTORY_SENSOR_ROOT',
28*91be1705SPatrick Williams    get_option('input-history-sensor-root'),
29*91be1705SPatrick Williams)
30*91be1705SPatrick Williamsconf.set10('UCD90160_DEVICE_ACCESS', get_option('ucd90160-access'))
3139b370a5SBrad Bishop
3239b370a5SBrad Bishopconfigure_file(output: 'config.h', configuration: conf)
3339b370a5SBrad Bishop
3439b370a5SBrad Bishop# Ensure the generated header here winds up in the correct path in the build
3539b370a5SBrad Bishop# tree such that it actually get used and doesn't get found in the sysroot
3639b370a5SBrad Bishop# somewhere.  Meson doesn't allow path elements (rightfully so) when specifying
3739b370a5SBrad Bishop# the output filename of a target definition so the target must be defined in
3839b370a5SBrad Bishop# the directory where the artifacts need to be placed.  Do that now, because
3939b370a5SBrad Bishop# the generated source (cpp) is needed to define the library target.
4039b370a5SBrad Bishopsubdir('org/open_power/Witherspoon/Fault')
4139b370a5SBrad Bishop
4239b370a5SBrad Bishoplibpower = static_library(
4339b370a5SBrad Bishop    'power',
4439b370a5SBrad Bishop    error_cpp,
4539b370a5SBrad Bishop    error_hpp,
4639b370a5SBrad Bishop    'gpio.cpp',
4739b370a5SBrad Bishop    'pmbus.cpp',
4839b370a5SBrad Bishop    'utility.cpp',
4939b370a5SBrad Bishop    dependencies: [
5039b370a5SBrad Bishop        phosphor_dbus_interfaces,
5139b370a5SBrad Bishop        phosphor_logging,
5239b370a5SBrad Bishop        sdbusplus,
5339b370a5SBrad Bishop        sdeventplus,
5439b370a5SBrad Bishop    ],
5539b370a5SBrad Bishop)
5639b370a5SBrad Bishop
5739b370a5SBrad Bishopsubdir('power-sequencer')
5839b370a5SBrad Bishopsubdir('power-supply')
5939b370a5SBrad Bishopsubdir('test')
60