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 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 28 | # Source files. |
| 29 | attn_src = files( |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 30 | 'attention.cpp', |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 31 | 'attn_common.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 32 | 'attn_config.cpp', |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 33 | 'attn_dbus.cpp', |
Ben Tyner | 7029e52 | 2021-08-09 19:18:24 -0500 | [diff] [blame] | 34 | 'attn_dump.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 35 | 'attn_handler.cpp', |
Ben Tyner | 46b5e2b | 2022-02-16 13:11:23 -0600 | [diff] [blame] | 36 | 'attn_logging.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 37 | 'attn_main.cpp', |
| 38 | 'attn_monitor.cpp', |
| 39 | 'bp_handler.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 40 | 'ti_handler.cpp', |
Ben Tyner | bcf65a8 | 2020-12-01 08:46:36 -0600 | [diff] [blame] | 41 | 'vital_handler.cpp', |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 42 | ) |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 43 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 44 | # for custom/raw PEL creation |
| 45 | pel_src = files( |
Ben Tyner | feeea83 | 2021-04-06 10:08:11 -0500 | [diff] [blame] | 46 | 'pel/extended_user_header.cpp', |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 47 | 'pel/pel_minimal.cpp', |
| 48 | 'pel/private_header.cpp', |
| 49 | 'pel/primary_src.cpp', |
| 50 | 'pel/user_header.cpp', |
| 51 | ) |
| 52 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 53 | # Library dependencies. |
| 54 | attn_deps = [ |
| 55 | libgpiod, |
| 56 | libpdbg_dep, |
| 57 | sdbusplus_dep, |
| 58 | ] |
| 59 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 60 | # conditional library dependencies |
| 61 | if get_option('phal').enabled() |
| 62 | attn_deps += libphal_dep |
| 63 | endif |
| 64 | |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 65 | # Create static library. |
| 66 | attn_lib = static_library( |
| 67 | 'attn_lib', |
| 68 | attn_src, |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 69 | pel_src, |
Zane Shelley | c252894 | 2020-12-02 15:42:42 -0600 | [diff] [blame] | 70 | include_directories : incdir, |
| 71 | dependencies : attn_deps, |
| 72 | cpp_args : [boost_args, test_arg], |
| 73 | install : false, |
| 74 | ) |