blob: 8c7d95fcb7087260c254a07fb733906fa9bfe407 [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:
Zane Shelley29237752021-12-22 11:00:30 -060025 dependency('systemd').get_variable(pkgconfig: 'systemdsystemunitdir')
Ben Tynerdb37c892020-02-19 13:08:48 -060026)
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
Ben Tyner13683082020-06-25 12:49:47 -050029if (true == phosphor_logging)
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050030 logging_src = 'attn_logging.cpp'
Ben Tyner9ae5ca42020-02-28 13:13:50 -060031else
32 logging_src = '../test/end2end/logging.cpp'
33endif
34
Zane Shelleyc2528942020-12-02 15:42:42 -060035# Source files.
36attn_src = files(
Ben Tyner188f1092021-02-01 09:33:06 -060037 'attention.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060038 'attn_common.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060039 'attn_config.cpp',
Ben Tyner188f1092021-02-01 09:33:06 -060040 'attn_dbus.cpp',
Ben Tyner7029e522021-08-09 19:18:24 -050041 'attn_dump.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060042 'attn_handler.cpp',
43 'attn_main.cpp',
44 'attn_monitor.cpp',
45 'bp_handler.cpp',
46 logging_src,
47 'ti_handler.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060048 'vital_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060049)
Ben Tyner9ae5ca42020-02-28 13:13:50 -060050
Ben Tynerf5210bb2021-01-05 12:58:10 -060051# for custom/raw PEL creation
52pel_src = files(
Ben Tynerfeeea832021-04-06 10:08:11 -050053 'pel/extended_user_header.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060054 'pel/pel_minimal.cpp',
55 'pel/private_header.cpp',
56 'pel/primary_src.cpp',
57 'pel/user_header.cpp',
58)
59
Zane Shelleyc2528942020-12-02 15:42:42 -060060# Library dependencies.
61attn_deps = [
62 libgpiod,
63 libpdbg_dep,
64 sdbusplus_dep,
65]
66
Ben Tynerb9715172021-09-29 08:46:19 -050067# conditional library dependencies
68if get_option('phal').enabled()
69 attn_deps += libphal_dep
70endif
71
Zane Shelleyc2528942020-12-02 15:42:42 -060072# Create static library.
73attn_lib = static_library(
74 'attn_lib',
75 attn_src,
Ben Tynerf5210bb2021-01-05 12:58:10 -060076 pel_src,
Zane Shelleyc2528942020-12-02 15:42:42 -060077 include_directories : incdir,
78 dependencies : attn_deps,
79 cpp_args : [boost_args, test_arg],
80 install : false,
81)