blob: 5d536740195f95e3016fff644e92262631be9472 [file] [log] [blame]
Ben Tyneref320152020-01-09 10:31:23 -06001# needed to find external libraries not registered with package manager
2cmplr = meson.get_compiler('cpp')
3
Ben Tyner73ac3682020-01-09 10:46:47 -06004# async gpio monitor needs boost library
5boost_args = ['-DBOOST_ASIO_DISABLE_THREADS',
6 '-DBOOST_ERROR_CODE_HEADER_ONLY',
7 '-DBOOST_SYSTEM_NO_DEPRECATED']
8
Ben Tyner9ae5ca42020-02-28 13:13:50 -06009# dependency to link sdbusplus support
Ben Tyneref320152020-01-09 10:31:23 -060010sdbusplus = dependency('sdbusplus', version : '>=1.0')
11
Ben Tyner73ac3682020-01-09 10:46:47 -060012# dependency to link gpiod support
13libgpiod = dependency('libgpiod', version : '>=1.4.1')
14
Ben Tyneref320152020-01-09 10:31:23 -060015# dependency to link libpdbg support
16libpdbg = cmplr.find_library('pdbg')
17
Ben Tynerdb37c892020-02-19 13:08:48 -060018# install systemd unit file
19configure_file(
20 input: 'attn_handler.service',
21 output: 'attn_handler.service',
22 copy: true,
23 install_dir:
24 dependency('systemd').get_pkgconfig_variable(
25 'systemdsystemunitdir')
26)
Ben Tyner0205f3b2020-02-24 10:24:47 -060027
Ben Tyner9ae5ca42020-02-28 13:13:50 -060028# see if phosphor-logging is available, if not use test case logging code
29h = 'phosphor-logging/log.hpp'
30if cmplr.compiles('#include <@0@>'.format(h), name : '#include <@0@>'.format(h))
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050031 logging_src = 'attn_logging.cpp'
Ben Tyner9ae5ca42020-02-28 13:13:50 -060032else
33 logging_src = '../test/end2end/logging.cpp'
34endif
35
36# gather attention sources to be used here and elsewhere if needed
37attn_src = files('attn_main.cpp', 'attn_handler.cpp', 'attn_monitor.cpp',
Ben Tynerb481d902020-03-05 10:24:23 -060038 'bp_handler.cpp', 'ti_handler.cpp', logging_src,
Ben Tyner3fb52e52020-03-31 10:10:07 -050039 'attention.cpp', 'attn_config.cpp')
Ben Tyner9ae5ca42020-02-28 13:13:50 -060040
41# Create attention handler library
Ben Tyner0205f3b2020-02-24 10:24:47 -060042attn = static_library('attn_handler',
Ben Tyner9ae5ca42020-02-28 13:13:50 -060043 attn_src,
44 include_directories : incdir,
Ben Tyner117af992020-05-22 13:32:11 -050045 dependencies : [libpdbg, sdbusplus, libgpiod],
Ben Tyner9ae5ca42020-02-28 13:13:50 -060046 cpp_args : boost_args,
47 install : true)