blob: 8430c07fbe5a23c50e6fcef3c15a6a244c8791a6 [file] [log] [blame]
Ben Tyner73ac3682020-01-09 10:46:47 -06001# async gpio monitor needs boost library
2boost_args = ['-DBOOST_ASIO_DISABLE_THREADS',
3 '-DBOOST_ERROR_CODE_HEADER_ONLY',
4 '-DBOOST_SYSTEM_NO_DEPRECATED']
5
Ben Tyner73ac3682020-01-09 10:46:47 -06006# dependency to link gpiod support
7libgpiod = dependency('libgpiod', version : '>=1.4.1')
8
Ben Tyner276e9812021-09-02 10:48:20 -05009# ENABLE_PHAL_TRUE used in attn_handler.service.in
10attn_conf = configuration_data()
11
Ben Tyner897a6f72021-07-30 10:59:23 -050012if (get_option('phal').enabled())
Ben Tyner276e9812021-09-02 10:48:20 -050013 attn_conf.set('ENABLE_PHAL_TRUE', '')
Ben Tyner897a6f72021-07-30 10:59:23 -050014else
Ben Tyner276e9812021-09-02 10:48:20 -050015 attn_conf.set('ENABLE_PHAL_TRUE', '#')
Ben Tyner897a6f72021-07-30 10:59:23 -050016endif
17
Ben Tynerdb37c892020-02-19 13:08:48 -060018# install systemd unit file
19configure_file(
Ben Tyner276e9812021-09-02 10:48:20 -050020 configuration: attn_conf,
21 input: 'attn_handler.service.in',
Ben Tynerdb37c892020-02-19 13:08:48 -060022 output: 'attn_handler.service',
Ben Tyner276e9812021-09-02 10:48:20 -050023 install: true,
Ben Tynerdb37c892020-02-19 13:08:48 -060024 install_dir:
25 dependency('systemd').get_pkgconfig_variable(
26 'systemdsystemunitdir')
27)
Ben Tyner0205f3b2020-02-24 10:24:47 -060028
Ben Tyner9ae5ca42020-02-28 13:13:50 -060029# see if phosphor-logging is available, if not use test case logging code
Ben Tyner13683082020-06-25 12:49:47 -050030if (true == phosphor_logging)
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
Zane Shelleyc2528942020-12-02 15:42:42 -060036# Source files.
37attn_src = files(
Ben Tyner188f1092021-02-01 09:33:06 -060038 'attention.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060039 'attn_common.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060040 'attn_config.cpp',
Ben Tyner188f1092021-02-01 09:33:06 -060041 'attn_dbus.cpp',
Ben Tyner7029e522021-08-09 19:18:24 -050042 'attn_dump.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060043 'attn_handler.cpp',
44 'attn_main.cpp',
45 'attn_monitor.cpp',
46 'bp_handler.cpp',
47 logging_src,
48 'ti_handler.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060049 'vital_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060050)
Ben Tyner9ae5ca42020-02-28 13:13:50 -060051
Ben Tynerf5210bb2021-01-05 12:58:10 -060052# for custom/raw PEL creation
53pel_src = files(
Ben Tynerfeeea832021-04-06 10:08:11 -050054 'pel/extended_user_header.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060055 'pel/pel_minimal.cpp',
56 'pel/private_header.cpp',
57 'pel/primary_src.cpp',
58 'pel/user_header.cpp',
59)
60
Zane Shelleyc2528942020-12-02 15:42:42 -060061# Library dependencies.
62attn_deps = [
63 libgpiod,
64 libpdbg_dep,
65 sdbusplus_dep,
66]
67
Ben Tynerb9715172021-09-29 08:46:19 -050068# conditional library dependencies
69if get_option('phal').enabled()
70 attn_deps += libphal_dep
71endif
72
Zane Shelleyc2528942020-12-02 15:42:42 -060073# Create static library.
74attn_lib = static_library(
75 'attn_lib',
76 attn_src,
Ben Tynerf5210bb2021-01-05 12:58:10 -060077 pel_src,
Zane Shelleyc2528942020-12-02 15:42:42 -060078 include_directories : incdir,
79 dependencies : attn_deps,
80 cpp_args : [boost_args, test_arg],
81 install : false,
82)