blob: 6ae7e58a38ffc54bae2026337152045152bdb0cb [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
Zane Shelleyc2528942020-12-02 15:42:42 -060028# Source files.
29attn_src = files(
Ben Tyner188f1092021-02-01 09:33:06 -060030 'attention.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060031 'attn_common.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060032 'attn_config.cpp',
Ben Tyner188f1092021-02-01 09:33:06 -060033 'attn_dbus.cpp',
Ben Tyner7029e522021-08-09 19:18:24 -050034 'attn_dump.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060035 'attn_handler.cpp',
Ben Tyner46b5e2b2022-02-16 13:11:23 -060036 'attn_logging.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060037 'attn_main.cpp',
38 'attn_monitor.cpp',
39 'bp_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060040 'ti_handler.cpp',
Ben Tynerbcf65a82020-12-01 08:46:36 -060041 'vital_handler.cpp',
Zane Shelleyc2528942020-12-02 15:42:42 -060042)
Ben Tyner9ae5ca42020-02-28 13:13:50 -060043
Ben Tynerf5210bb2021-01-05 12:58:10 -060044# for custom/raw PEL creation
45pel_src = files(
Ben Tynerfeeea832021-04-06 10:08:11 -050046 'pel/extended_user_header.cpp',
Ben Tynerf5210bb2021-01-05 12:58:10 -060047 'pel/pel_minimal.cpp',
48 'pel/private_header.cpp',
49 'pel/primary_src.cpp',
50 'pel/user_header.cpp',
51)
52
Zane Shelleyc2528942020-12-02 15:42:42 -060053# Library dependencies.
54attn_deps = [
55 libgpiod,
56 libpdbg_dep,
57 sdbusplus_dep,
58]
59
Ben Tynerb9715172021-09-29 08:46:19 -050060# conditional library dependencies
61if get_option('phal').enabled()
62 attn_deps += libphal_dep
63endif
64
Zane Shelleyc2528942020-12-02 15:42:42 -060065# Create static library.
66attn_lib = static_library(
67 'attn_lib',
68 attn_src,
Ben Tynerf5210bb2021-01-05 12:58:10 -060069 pel_src,
Zane Shelleyc2528942020-12-02 15:42:42 -060070 include_directories : incdir,
71 dependencies : attn_deps,
72 cpp_args : [boost_args, test_arg],
73 install : false,
74)