Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 1 | # needed to find external libraries not registered with package manager |
| 2 | cmplr = meson.get_compiler('cpp') |
| 3 | |
Ben Tyner | 73ac368 | 2020-01-09 10:46:47 -0600 | [diff] [blame] | 4 | # async gpio monitor needs boost library |
| 5 | boost_args = ['-DBOOST_ASIO_DISABLE_THREADS', |
| 6 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 7 | '-DBOOST_SYSTEM_NO_DEPRECATED'] |
| 8 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 9 | # dependency to link sdbusplus support |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 10 | sdbusplus = dependency('sdbusplus', version : '>=1.0') |
| 11 | |
Ben Tyner | 73ac368 | 2020-01-09 10:46:47 -0600 | [diff] [blame] | 12 | # dependency to link gpiod support |
| 13 | libgpiod = dependency('libgpiod', version : '>=1.4.1') |
| 14 | |
Ben Tyner | ef32015 | 2020-01-09 10:31:23 -0600 | [diff] [blame] | 15 | # dependency to link libpdbg support |
| 16 | libpdbg = cmplr.find_library('pdbg') |
| 17 | |
| 18 | # libpdbg requires linking with "whole-archive" option |
| 19 | whole_archive = declare_dependency(link_args : '-Wl,--whole-archive') |
| 20 | no_whole_archive = declare_dependency(link_args : '-Wl,--no-whole-archive') |
| 21 | |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 22 | # install systemd unit file |
| 23 | configure_file( |
| 24 | input: 'attn_handler.service', |
| 25 | output: 'attn_handler.service', |
| 26 | copy: true, |
| 27 | install_dir: |
| 28 | dependency('systemd').get_pkgconfig_variable( |
| 29 | 'systemdsystemunitdir') |
| 30 | ) |
Ben Tyner | 0205f3b | 2020-02-24 10:24:47 -0600 | [diff] [blame] | 31 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 32 | # see if phosphor-logging is available, if not use test case logging code |
| 33 | h = 'phosphor-logging/log.hpp' |
| 34 | if cmplr.compiles('#include <@0@>'.format(h), name : '#include <@0@>'.format(h)) |
| 35 | logging_src = 'logging.cpp' |
| 36 | else |
| 37 | logging_src = '../test/end2end/logging.cpp' |
| 38 | endif |
| 39 | |
| 40 | # gather attention sources to be used here and elsewhere if needed |
| 41 | attn_src = files('attn_main.cpp', 'attn_handler.cpp', 'attn_monitor.cpp', |
| 42 | 'bp_handler.cpp', 'ti_handler.cpp', logging_src) |
| 43 | |
| 44 | # Create attention handler library |
Ben Tyner | 0205f3b | 2020-02-24 10:24:47 -0600 | [diff] [blame] | 45 | attn = static_library('attn_handler', |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 46 | attn_src, |
| 47 | include_directories : incdir, |
| 48 | dependencies : [whole_archive, libpdbg, |
| 49 | no_whole_archive, sdbusplus, libgpiod], |
| 50 | cpp_args : boost_args, |
| 51 | install : true) |