Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | |
| 3 | project('phosphor-debug-collector', |
| 4 | 'cpp', |
Patrick Williams | deed959 | 2023-07-12 11:15:33 -0500 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 6 | default_options: [ |
Patrick Williams | deed959 | 2023-07-12 11:15:33 -0500 | [diff] [blame] | 7 | 'cpp_std=c++23', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 8 | 'warning_level=3', |
PriyangaRamasamy | 01c6646 | 2021-02-23 05:46:25 -0600 | [diff] [blame] | 9 | 'werror=true', |
| 10 | 'buildtype=debugoptimized' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 11 | ], |
| 12 | version: '1.0', |
| 13 | license: 'Apache-2.0' |
| 14 | ) |
| 15 | |
Patrick Williams | abbe159 | 2021-10-01 16:04:19 -0500 | [diff] [blame] | 16 | cpp = meson.get_compiler('cpp') |
| 17 | |
Dhruvaraj Subhashchandran | 9f55736 | 2021-05-12 06:28:20 -0500 | [diff] [blame] | 18 | # list of unit files, the path as input and service name |
| 19 | # as output |
| 20 | # eg: unit_file += {'input:'<path>, 'output':<service name>} |
| 21 | unit_files = [] |
| 22 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 23 | # Checking dependency external library |
| 24 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 25 | libsystemd = dependency('libsystemd', version : '>=221') |
George Liu | 73e0bab | 2021-06-29 15:57:43 +0800 | [diff] [blame] | 26 | |
Patrick Williams | 02634e5 | 2022-03-21 11:16:11 -0500 | [diff] [blame] | 27 | sdbusplus_dep = dependency('sdbusplus') |
| 28 | sdbusplusplus_prog = find_program('sdbus++') |
| 29 | sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson') |
Marri Devender Rao | 3ed02c3 | 2022-06-28 23:12:14 -0500 | [diff] [blame] | 30 | sdeventplus_dep = dependency('sdeventplus') |
Patrick Williams | 02634e5 | 2022-03-21 11:16:11 -0500 | [diff] [blame] | 31 | |
| 32 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 33 | phosphor_logging_dep = dependency('phosphor-logging') |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 34 | |
Dhruvaraj Subhashchandran | 50646c2 | 2024-06-19 22:51:50 -0500 | [diff] [blame] | 35 | # nlohmann-json dependency |
| 36 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
| 37 | |
Patrick Williams | abbe159 | 2021-10-01 16:04:19 -0500 | [diff] [blame] | 38 | # Get Cereal dependency. |
| 39 | cereal_dep = dependency('cereal', required: false) |
| 40 | has_cereal = cpp.has_header_symbol( |
| 41 | 'cereal/cereal.hpp', |
| 42 | 'cereal::specialize', |
| 43 | dependencies: cereal_dep, |
| 44 | required: false) |
| 45 | if not has_cereal |
| 46 | cereal_opts = import('cmake').subproject_options() |
Konstantin Aladyshev | 71a20da | 2024-04-02 17:42:46 +0300 | [diff] [blame] | 47 | cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'}) |
Patrick Williams | abbe159 | 2021-10-01 16:04:19 -0500 | [diff] [blame] | 48 | cereal_proj = import('cmake').subproject( |
| 49 | 'cereal', |
| 50 | options: cereal_opts, |
| 51 | required: false) |
| 52 | assert(cereal_proj.found(), 'cereal is required') |
| 53 | cereal_dep = cereal_proj.dependency('cereal') |
| 54 | endif |
| 55 | |
PriyangaRamasamy | 01c6646 | 2021-02-23 05:46:25 -0600 | [diff] [blame] | 56 | # Disable FORTIFY_SOURCE when compiling with no optimization |
| 57 | if(get_option('optimization') == '0') |
| 58 | add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c']) |
| 59 | message('Disabling FORTIFY_SOURCE as optimization is set to 0') |
| 60 | endif |
| 61 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 62 | # Configuration header file(config.h) generation |
| 63 | |
| 64 | conf_data = configuration_data() |
| 65 | |
| 66 | conf_data.set_quoted('DUMP_BUSNAME', get_option('DUMP_BUSNAME'), |
| 67 | description : 'The Dbus busname to own' |
| 68 | ) |
| 69 | conf_data.set_quoted('DUMP_OBJPATH', get_option('DUMP_OBJPATH'), |
| 70 | description : 'The Dump manager Dbus root' |
| 71 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 72 | conf_data.set_quoted('BMC_DUMP_OBJPATH', get_option('BMC_DUMP_OBJPATH'), |
| 73 | description : 'The BMC Dump manager Dbus path' |
| 74 | ) |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 75 | conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'), |
| 76 | description : 'Directory where core dumps are placed' |
| 77 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 78 | conf_data.set_quoted('BMC_DUMP_OBJ_ENTRY', get_option('BMC_DUMP_OBJ_ENTRY'), |
| 79 | description : 'The BMC dump entry DBus object path' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 80 | ) |
| 81 | conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'), |
| 82 | description : 'Directory where bmc dumps are placed') |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 83 | conf_data.set_quoted('SYSTEMD_PSTORE_PATH', get_option('SYSTEMD_PSTORE_PATH'), |
| 84 | description : 'Path to the systemd pstore directory') |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 85 | conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'), |
| 86 | description : 'Maximum size of one bmc dump in kilo bytes' |
| 87 | ) |
| 88 | conf_data.set('BMC_DUMP_MIN_SPACE_REQD', get_option('BMC_DUMP_MIN_SPACE_REQD'), |
| 89 | description : 'Minimum space required for one bmc dump in kilo bytes' |
| 90 | ) |
| 91 | conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'), |
| 92 | description : 'Total size of the dump in kilo bytes' |
| 93 | ) |
| 94 | conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging', |
| 95 | description : 'The log manager DBus object path' |
| 96 | ) |
| 97 | conf_data.set_quoted('ELOG_ID_PERSIST_PATH', get_option('ELOG_ID_PERSIST_PATH'), |
| 98 | description : 'Path of file for storing elog id\'s, which have associated dumps' |
| 99 | ) |
| 100 | conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'), |
| 101 | description : 'Class version to register with Cereal' |
| 102 | ) |
| 103 | conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'), |
| 104 | description : 'YAML filepath containing error object paths' |
| 105 | ) |
Patrick Williams | 7cd0528 | 2023-11-29 06:44:29 -0600 | [diff] [blame] | 106 | conf_data.set('JFFS_CORE_FILE_WORKAROUND', get_option('jffs-workaround').allowed(), |
Chirag Sharma | e22aca7 | 2021-01-18 09:55:29 -0600 | [diff] [blame] | 107 | description : 'Turn on jffs workaround for core file' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 108 | ) |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 109 | conf_data.set_quoted('FAULTLOG_DUMP_OBJ_ENTRY', get_option('FAULTLOG_DUMP_OBJ_ENTRY'), |
| 110 | description : 'The Fault Log dump entry DBus object path' |
| 111 | ) |
| 112 | conf_data.set_quoted('FAULTLOG_DUMP_OBJPATH', get_option('FAULTLOG_DUMP_OBJPATH'), |
| 113 | description : 'The Fault Log Dump manager Dbus path' |
| 114 | ) |
| 115 | conf_data.set_quoted('FAULTLOG_DUMP_PATH', get_option('FAULTLOG_DUMP_PATH'), |
| 116 | description : 'Directory where fault logs are placed' |
| 117 | ) |
Patrick Williams | 7cd0528 | 2023-11-29 06:44:29 -0600 | [diff] [blame] | 118 | conf_data.set('BMC_DUMP_ROTATE_CONFIG', get_option('dump_rotate_config').allowed(), |
Xie Ning | fc69f35 | 2022-05-17 16:06:52 +0800 | [diff] [blame] | 119 | description : 'Turn on rotate config for bmc dump' |
| 120 | ) |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 121 | |
| 122 | configure_file(configuration : conf_data, |
| 123 | output : 'config.h' |
| 124 | ) |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 125 | |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 126 | dump_types_yaml_files = [] |
| 127 | |
| 128 | # Dump types YAML file |
| 129 | dump_types_yaml_files += {'input': 'example_dump_types.yaml', |
| 130 | 'output': 'dump_types.yaml'} |
| 131 | |
| 132 | # Copy and combine YAML files |
| 133 | concatenate_command = 'cat ' |
| 134 | combined_yaml_file = 'combined_dump_types.yaml' |
| 135 | |
| 136 | foreach yaml_file : dump_types_yaml_files |
| 137 | configure_file(input : yaml_file.get('input'), |
| 138 | output : yaml_file.get('output'), |
| 139 | copy : true) |
Konstantin Aladyshev | df01f8a | 2024-04-02 17:50:49 +0300 | [diff] [blame] | 140 | concatenate_command += meson.project_build_root() + '/' + yaml_file.get('output') + ' ' |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 141 | endforeach |
| 142 | |
Konstantin Aladyshev | df01f8a | 2024-04-02 17:50:49 +0300 | [diff] [blame] | 143 | concatenate_command += '> ' + meson.project_build_root() + '/' + combined_yaml_file |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 144 | run_command('sh', '-c', concatenate_command) |
| 145 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 146 | python = find_program('python3') |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 147 | map_gen_file_loc = meson.project_source_root() |
| 148 | map_gen_file_loc += '/map_gen.py' |
| 149 | |
| 150 | dump_types_hpp = custom_target( |
| 151 | 'dump_types.hpp', |
| 152 | command : [ |
| 153 | python, |
| 154 | map_gen_file_loc, |
| 155 | '-i', |
Konstantin Aladyshev | df01f8a | 2024-04-02 17:50:49 +0300 | [diff] [blame] | 156 | meson.project_build_root() + '/' + combined_yaml_file, |
Dhruvaraj Subhashchandran | aa0937f | 2023-07-22 23:50:40 -0500 | [diff] [blame] | 157 | '-j', |
| 158 | get_option('ERROR_MAP_YAML'), |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 159 | '-t', |
| 160 | 'dump_types.mako.hpp', |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 161 | '-o', |
| 162 | 'dump_types.hpp' |
| 163 | ], |
| 164 | depend_files : [ 'dump_types.mako.hpp', |
| 165 | 'map_gen.py', |
Konstantin Aladyshev | df01f8a | 2024-04-02 17:50:49 +0300 | [diff] [blame] | 166 | meson.project_build_root() + '/' + combined_yaml_file, |
Dhruvaraj Subhashchandran | aa0937f | 2023-07-22 23:50:40 -0500 | [diff] [blame] | 167 | get_option('ERROR_MAP_YAML') |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 168 | ], |
| 169 | output : 'dump_types.hpp' |
| 170 | ) |
| 171 | |
| 172 | dump_types_cpp = custom_target( |
| 173 | 'dump_types.cpp', |
| 174 | command : [ |
| 175 | python, |
| 176 | map_gen_file_loc, |
| 177 | '-i', |
Konstantin Aladyshev | df01f8a | 2024-04-02 17:50:49 +0300 | [diff] [blame] | 178 | meson.project_build_root() + '/' + combined_yaml_file, |
Dhruvaraj Subhashchandran | aa0937f | 2023-07-22 23:50:40 -0500 | [diff] [blame] | 179 | '-j', |
| 180 | get_option('ERROR_MAP_YAML'), |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 181 | '-t', |
| 182 | 'dump_types.mako.cpp', |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 183 | '-o', |
| 184 | 'dump_types.cpp' |
| 185 | ], |
| 186 | depend_files : [ 'dump_types.mako.cpp', |
| 187 | 'map_gen.py', |
Konstantin Aladyshev | df01f8a | 2024-04-02 17:50:49 +0300 | [diff] [blame] | 188 | meson.project_build_root() + '/' + combined_yaml_file, |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 189 | get_option('ERROR_MAP_YAML') |
| 190 | ], |
Dhruvaraj Subhashchandran | aa0937f | 2023-07-22 23:50:40 -0500 | [diff] [blame] | 191 | output : 'dump_types.cpp' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 192 | ) |
| 193 | |
| 194 | phosphor_dump_manager_sources = [ |
| 195 | 'dump_entry.cpp', |
| 196 | 'dump_manager.cpp', |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 197 | 'dump_manager_bmc.cpp', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 198 | 'dump_manager_main.cpp', |
| 199 | 'dump_serialize.cpp', |
| 200 | 'elog_watch.cpp', |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 201 | dump_types_hpp, |
| 202 | dump_types_cpp, |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 203 | 'watch.cpp', |
| 204 | 'bmc_dump_entry.cpp', |
| 205 | 'dump_utils.cpp', |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 206 | 'dump_offload.cpp', |
| 207 | 'dump_manager_faultlog.cpp', |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 208 | 'faultlog_dump_entry.cpp' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 209 | ] |
| 210 | |
| 211 | phosphor_dump_manager_dependency = [ |
George Liu | 73e0bab | 2021-06-29 15:57:43 +0800 | [diff] [blame] | 212 | phosphor_dbus_interfaces_dep, |
| 213 | sdbusplus_dep, |
Marri Devender Rao | 3ed02c3 | 2022-06-28 23:12:14 -0500 | [diff] [blame] | 214 | sdeventplus_dep, |
George Liu | 73e0bab | 2021-06-29 15:57:43 +0800 | [diff] [blame] | 215 | phosphor_logging_dep, |
Patrick Williams | abbe159 | 2021-10-01 16:04:19 -0500 | [diff] [blame] | 216 | cereal_dep, |
Dhruvaraj Subhashchandran | 50646c2 | 2024-06-19 22:51:50 -0500 | [diff] [blame] | 217 | nlohmann_json_dep, |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 218 | ] |
| 219 | |
| 220 | phosphor_dump_manager_install = true |
| 221 | |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 222 | phosphor_dump_manager_incdir = [] |
| 223 | |
Ramesh Iyyar | 131994b | 2020-12-03 08:35:36 -0600 | [diff] [blame] | 224 | # To get host transport based interface to take respective host |
| 225 | # dump actions. It will contain required sources and dependency |
| 226 | # list for phosphor_dump_manager. |
| 227 | subdir('host-transport-extensions') |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 228 | |
Dhruvaraj Subhashchandran | 8b9b469 | 2020-09-24 11:59:42 -0500 | [diff] [blame] | 229 | #pick any architecture specific dumps |
| 230 | subdir('dump-extensions') |
| 231 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 232 | phosphor_dump_monitor_sources = [ |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 233 | dump_types_hpp, |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 234 | 'core_manager.cpp', |
| 235 | 'core_manager_main.cpp', |
| 236 | 'watch.cpp' |
| 237 | ] |
| 238 | |
| 239 | phosphor_dump_monitor_dependency = [ |
George Liu | 73e0bab | 2021-06-29 15:57:43 +0800 | [diff] [blame] | 240 | phosphor_dbus_interfaces_dep, |
Patrick Williams | 0722271 | 2024-02-26 10:37:10 -0600 | [diff] [blame] | 241 | phosphor_logging_dep, |
| 242 | sdeventplus_dep, |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 243 | ] |
| 244 | |
| 245 | phosphor_dump_monitor_install = true |
| 246 | |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 247 | phosphor_dump_monitor_incdir = [] |
| 248 | |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 249 | phosphor_ramoops_monitor_sources = [ |
Dhruvaraj Subhashchandran | c1f5ed6 | 2023-07-09 04:31:28 -0500 | [diff] [blame] | 250 | dump_types_hpp, |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 251 | 'ramoops_manager.cpp', |
| 252 | 'ramoops_manager_main.cpp', |
| 253 | 'watch.cpp' |
| 254 | ] |
| 255 | |
| 256 | phosphor_ramoops_monitor_dependency = [ |
George Liu | 858fbb2 | 2021-07-01 12:25:44 +0800 | [diff] [blame] | 257 | phosphor_dbus_interfaces_dep, |
Patrick Williams | 0722271 | 2024-02-26 10:37:10 -0600 | [diff] [blame] | 258 | phosphor_logging_dep, |
| 259 | sdeventplus_dep, |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 260 | ] |
| 261 | |
| 262 | phosphor_ramoops_monitor_install = true |
| 263 | |
| 264 | phosphor_ramoops_monitor_incdir = [] |
| 265 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 266 | executables = [[ 'phosphor-dump-manager', |
| 267 | phosphor_dump_manager_sources, |
| 268 | phosphor_dump_manager_dependency, |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 269 | phosphor_dump_manager_install, |
| 270 | phosphor_dump_manager_incdir |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 271 | ], |
| 272 | [ 'phosphor-dump-monitor', |
| 273 | phosphor_dump_monitor_sources, |
| 274 | phosphor_dump_monitor_dependency, |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 275 | phosphor_dump_monitor_install, |
| 276 | phosphor_dump_monitor_incdir |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame] | 277 | ], |
| 278 | [ 'phosphor-ramoops-monitor', |
| 279 | phosphor_ramoops_monitor_sources, |
| 280 | phosphor_ramoops_monitor_dependency, |
| 281 | phosphor_ramoops_monitor_install, |
| 282 | phosphor_ramoops_monitor_incdir |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 283 | ] |
| 284 | ] |
| 285 | |
| 286 | foreach executable : executables |
| 287 | binary = executable( |
| 288 | executable[0], |
| 289 | executable[1], |
| 290 | dependencies: executable[2], |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 291 | install : executable[3], |
| 292 | include_directories : executable[4] |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 293 | ) |
| 294 | endforeach |
Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 295 | |
Dhruvaraj Subhashchandran | 9f55736 | 2021-05-12 06:28:20 -0500 | [diff] [blame] | 296 | unit_subs = configuration_data() |
| 297 | unit_subs.set('bindir', join_paths(get_option('prefix'), get_option('bindir'))) |
Patrick Williams | 6c84a8c | 2023-04-12 08:10:41 -0500 | [diff] [blame] | 298 | systemd_system_unit_dir = dependency('systemd').get_variable( |
Dhruvaraj Subhashchandran | 9f55736 | 2021-05-12 06:28:20 -0500 | [diff] [blame] | 299 | 'systemdsystemunitdir', |
Patrick Williams | 6c84a8c | 2023-04-12 08:10:41 -0500 | [diff] [blame] | 300 | pkgconfig_define: ['prefix', get_option('prefix')]) |
Dhruvaraj Subhashchandran | 9f55736 | 2021-05-12 06:28:20 -0500 | [diff] [blame] | 301 | foreach u : unit_files |
| 302 | configure_file( |
| 303 | configuration: unit_subs, |
| 304 | input: u.get('input'), |
| 305 | install: true, |
| 306 | install_dir: systemd_system_unit_dir, |
| 307 | output: u.get('output') |
| 308 | ) |
| 309 | endforeach |
| 310 | |
Patrick Williams | 7cd0528 | 2023-11-29 06:44:29 -0600 | [diff] [blame] | 311 | if get_option('tests').allowed() |
Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 312 | subdir('test') |
| 313 | endif |