1# async gpio monitor needs boost library
2boost_args = ['-DBOOST_ASIO_DISABLE_THREADS',
3              '-DBOOST_ERROR_CODE_HEADER_ONLY',
4              '-DBOOST_SYSTEM_NO_DEPRECATED']
5
6# dependency to link gpiod support
7libgpiod = dependency('libgpiod', version : '>=1.4.1')
8
9# ENABLE_PHAL_TRUE used in attn_handler.service.in
10attn_conf = configuration_data()
11
12if (get_option('phal').enabled())
13    attn_conf.set('ENABLE_PHAL_TRUE', '')
14else
15    attn_conf.set('ENABLE_PHAL_TRUE', '#')
16endif
17
18# install systemd unit file
19configure_file(
20    configuration: attn_conf,
21    input: 'attn_handler.service.in',
22    output: 'attn_handler.service',
23    install: true,
24    install_dir:
25        dependency('systemd').get_variable(pkgconfig: 'systemdsystemunitdir')
26)
27
28# Source files.
29attn_src = files(
30    'attention.cpp',
31    'attn_common.cpp',
32    'attn_config.cpp',
33    'attn_dbus.cpp',
34    'attn_dump.cpp',
35    'attn_handler.cpp',
36    'attn_logging.cpp',
37    'attn_main.cpp',
38    'attn_monitor.cpp',
39    'bp_handler.cpp',
40    'ti_handler.cpp',
41    'vital_handler.cpp',
42)
43
44# for custom/raw PEL creation
45pel_src = files(
46    'pel/extended_user_header.cpp',
47    'pel/pel_minimal.cpp',
48    'pel/private_header.cpp',
49    'pel/primary_src.cpp',
50    'pel/user_header.cpp',
51)
52
53# Library dependencies.
54attn_deps = [
55    libgpiod,
56    libpdbg_dep,
57    sdbusplus_dep,
58]
59
60# conditional library dependencies
61if get_option('phal').enabled()
62  attn_deps += libphal_dep
63endif
64
65# Create static library.
66attn_lib = static_library(
67    'attn_lib',
68    attn_src,
69    pel_src,
70    include_directories : incdir,
71    dependencies : attn_deps,
72    cpp_args : [boost_args],
73    install : false,
74)
75