Ben Tyner | 73ac368 | 2020-01-09 10:46:47 -0600 | [diff] [blame] | 1 | # async gpio monitor needs boost library |
| 2 | boost_args = ['-DBOOST_ASIO_DISABLE_THREADS', |
| 3 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 4 | '-DBOOST_SYSTEM_NO_DEPRECATED'] |
| 5 | |
Ben Tyner | 73ac368 | 2020-01-09 10:46:47 -0600 | [diff] [blame] | 6 | # dependency to link gpiod support |
| 7 | libgpiod = dependency('libgpiod', version : '>=1.4.1') |
| 8 | |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 9 | # ENABLE_PHAL_TRUE used in attn_handler.service.in |
| 10 | attn_conf = configuration_data() |
| 11 | |
Ben Tyner | 897a6f7 | 2021-07-30 10:59:23 -0500 | [diff] [blame] | 12 | if (get_option('phal').enabled()) |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 13 | attn_conf.set('ENABLE_PHAL_TRUE', '') |
Ben Tyner | 897a6f7 | 2021-07-30 10:59:23 -0500 | [diff] [blame] | 14 | else |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 15 | attn_conf.set('ENABLE_PHAL_TRUE', '#') |
Ben Tyner | 897a6f7 | 2021-07-30 10:59:23 -0500 | [diff] [blame] | 16 | endif |
| 17 | |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 18 | # install systemd unit file |
| 19 | configure_file( |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 20 | configuration: attn_conf, |
| 21 | input: 'attn_handler.service.in', |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 22 | output: 'attn_handler.service', |
Ben Tyner | 276e981 | 2021-09-02 10:48:20 -0500 | [diff] [blame] | 23 | install: true, |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 24 | install_dir: |
Zane Shelley | 2923775 | 2021-12-22 11:00:30 -0600 | [diff] [blame] | 25 | dependency('systemd').get_variable(pkgconfig: 'systemdsystemunitdir') |
Ben Tyner | db37c89 | 2020-02-19 13:08:48 -0600 | [diff] [blame] | 26 | ) |
Ben Tyner | 0205f3b | 2020-02-24 10:24:47 -0600 | [diff] [blame] | 27 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 28 | # see if phosphor-logging is available, if not use test case logging code |
Ben Tyner | 1368308 | 2020-06-25 12:49:47 -0500 | [diff] [blame] | 29 | if (true == phosphor_logging) |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 30 | logging_src = 'attn_logging.cpp' |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 31 | else |
| 32 | logging_src = '../test/end2end/logging.cpp' |
| 33 | endif |
| 34 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 35 | # Source files. |
| 36 | attn_src = files( |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 37 | 'attention.cpp', |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 38 | 'attn_common.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 39 | 'attn_config.cpp', |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 40 | 'attn_dbus.cpp', |
Ben Tyner | 7029e52 | 2021-08-09 19:18:24 -0500 | [diff] [blame] | 41 | 'attn_dump.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 42 | 'attn_handler.cpp', |
| 43 | 'attn_main.cpp', |
| 44 | 'attn_monitor.cpp', |
| 45 | 'bp_handler.cpp', |
| 46 | logging_src, |
| 47 | 'ti_handler.cpp', |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 48 | 'vital_handler.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 49 | ) |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 50 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 51 | # for custom/raw PEL creation |
| 52 | pel_src = files( |
Ben Tyner | feeea83 | 2021-04-06 10:08:11 -0500 | [diff] [blame] | 53 | 'pel/extended_user_header.cpp', |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 54 | 'pel/pel_minimal.cpp', |
| 55 | 'pel/private_header.cpp', |
| 56 | 'pel/primary_src.cpp', |
| 57 | 'pel/user_header.cpp', |
| 58 | ) |
| 59 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 60 | # Library dependencies. |
| 61 | attn_deps = [ |
| 62 | libgpiod, |
| 63 | libpdbg_dep, |
| 64 | sdbusplus_dep, |
| 65 | ] |
| 66 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 67 | # conditional library dependencies |
| 68 | if get_option('phal').enabled() |
| 69 | attn_deps += libphal_dep |
| 70 | endif |
| 71 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 72 | # Create static library. |
| 73 | attn_lib = static_library( |
| 74 | 'attn_lib', |
| 75 | attn_src, |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 76 | pel_src, |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 77 | include_directories : incdir, |
| 78 | dependencies : attn_deps, |
| 79 | cpp_args : [boost_args, test_arg], |
| 80 | install : false, |
| 81 | ) |