Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 1 | project('phosphor-bmc-code-mgmt', 'cpp', |
| 2 | default_options: [ |
Gunnar Mills | f7a69e1 | 2020-06-15 12:16:51 -0500 | [diff] [blame] | 3 | 'buildtype=debugoptimized', |
Patrick Williams | b9ecb2b | 2023-07-12 11:15:11 -0500 | [diff] [blame] | 4 | 'cpp_std=c++23', |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 5 | 'warning_level=3', |
Gunnar Mills | f7a69e1 | 2020-06-15 12:16:51 -0500 | [diff] [blame] | 6 | 'werror=true' |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 7 | ], |
Patrick Williams | b9ecb2b | 2023-07-12 11:15:11 -0500 | [diff] [blame] | 8 | meson_version: '>=1.1.1', |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 9 | license: 'Apache-2.0', |
| 10 | version: '1.0') |
| 11 | |
Lei YU | 2586818 | 2021-05-14 14:50:51 +0800 | [diff] [blame] | 12 | add_project_arguments( |
| 13 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
| 14 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 15 | '-DBOOST_NO_RTTI', |
| 16 | '-DBOOST_NO_TYPEID', |
| 17 | '-DBOOST_ALL_NO_LIB', |
| 18 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 19 | '-DBOOST_ASIO_NO_DEPRECATED', |
| 20 | language: 'cpp', |
| 21 | ) |
| 22 | |
Patrick Williams | 4026702 | 2021-08-26 16:48:42 -0500 | [diff] [blame] | 23 | cpp = meson.get_compiler('cpp') |
| 24 | |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 25 | conf = configuration_data() |
| 26 | |
| 27 | # DBus information |
| 28 | conf.set_quoted('BMC_INVENTORY_INTERFACE', 'xyz.openbmc_project.Inventory.Item.Bmc') |
| 29 | conf.set_quoted('BUSNAME_UPDATER', 'xyz.openbmc_project.Software.BMC.Updater') |
| 30 | conf.set_quoted('DOWNLOAD_BUSNAME', 'xyz.openbmc_project.Software.Download') |
| 31 | conf.set_quoted('FILEPATH_IFACE', 'xyz.openbmc_project.Common.FilePath') |
| 32 | conf.set_quoted('INVENTORY_PATH', '/xyz/openbmc_project/inventory/') |
| 33 | conf.set_quoted('MAPPER_BUSNAME', 'xyz.openbmc_project.ObjectMapper') |
| 34 | conf.set_quoted('MAPPER_INTERFACE', 'xyz.openbmc_project.ObjectMapper') |
| 35 | conf.set_quoted('MAPPER_PATH', '/xyz/openbmc_project/object_mapper') |
| 36 | conf.set_quoted('SOFTWARE_OBJPATH', '/xyz/openbmc_project/software') |
| 37 | conf.set_quoted('SYSTEMD_BUSNAME', 'org.freedesktop.systemd1') |
| 38 | conf.set_quoted('SYSTEMD_PATH', '/org/freedesktop/systemd1') |
| 39 | conf.set_quoted('SYSTEMD_INTERFACE', 'org.freedesktop.systemd1.Manager') |
| 40 | conf.set_quoted('VERSION_BUSNAME', 'xyz.openbmc_project.Software.Version') |
| 41 | conf.set_quoted('VERSION_IFACE', 'xyz.openbmc_project.Software.Version') |
Chanh Nguyen | 1fd6ddd | 2021-01-06 11:09:09 +0700 | [diff] [blame] | 42 | conf.set_quoted('EXTENDED_VERSION_IFACE', 'xyz.openbmc_project.Software.ExtendedVersion') |
Justin Ledford | 054bb0b | 2022-03-15 15:46:58 -0700 | [diff] [blame] | 43 | conf.set_quoted('COMPATIBLE_IFACE', 'xyz.openbmc_project.Inventory.Decorator.Compatible') |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 44 | |
| 45 | # Names of the forward and reverse associations |
| 46 | conf.set_quoted('ACTIVATION_FWD_ASSOCIATION', 'inventory') |
| 47 | conf.set_quoted('ACTIVATION_REV_ASSOCIATION', 'activation') |
| 48 | conf.set_quoted('ACTIVE_FWD_ASSOCIATION', 'active') |
| 49 | conf.set_quoted('ACTIVE_REV_ASSOCIATION', 'software_version') |
| 50 | conf.set_quoted('FUNCTIONAL_FWD_ASSOCIATION', 'functional') |
| 51 | conf.set_quoted('FUNCTIONAL_REV_ASSOCIATION', 'software_version') |
| 52 | conf.set_quoted('UPDATEABLE_FWD_ASSOCIATION', 'updateable') |
| 53 | conf.set_quoted('UPDATEABLE_REV_ASSOCIATION', 'software_version') |
| 54 | |
| 55 | # Filesystem files and directories |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 56 | # The prefix path for the versioned read-only bmc partitions |
| 57 | conf.set_quoted('BMC_ROFS_PREFIX', get_option('media-dir') + '/rofs-') |
| 58 | # The name of the BMC table of contents file |
| 59 | conf.set_quoted('OS_RELEASE_FILE', '/etc/os-release') |
| 60 | # The dir where activation data is stored in files |
| 61 | conf.set_quoted('PERSIST_DIR', '/var/lib/phosphor-bmc-code-mgmt/') |
| 62 | |
| 63 | # Supported BMC layout types |
| 64 | conf.set('STATIC_LAYOUT', get_option('bmc-layout').contains('static')) |
| 65 | conf.set('UBIFS_LAYOUT', get_option('bmc-layout').contains('ubi')) |
Adriana Kobylak | 70f5bc0 | 2020-05-13 14:08:14 -0500 | [diff] [blame] | 66 | conf.set('MMC_LAYOUT', get_option('bmc-layout').contains('mmc')) |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 67 | |
| 68 | # Configurable features |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 69 | conf.set('HOST_BIOS_UPGRADE', get_option('host-bios-upgrade').allowed()) |
| 70 | conf.set('WANT_SIGNATURE_VERIFY', get_option('verify-signature').allowed()) |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 71 | |
| 72 | # Configurable variables |
| 73 | conf.set('ACTIVE_BMC_MAX_ALLOWED', get_option('active-bmc-max-allowed')) |
| 74 | conf.set_quoted('HASH_FILE_NAME', get_option('hash-file-name')) |
| 75 | conf.set_quoted('IMG_UPLOAD_DIR', get_option('img-upload-dir')) |
| 76 | conf.set_quoted('MANIFEST_FILE_NAME', get_option('manifest-file-name')) |
| 77 | conf.set_quoted('MEDIA_DIR', get_option('media-dir')) |
Adriana Kobylak | 73609bb | 2020-06-18 15:05:40 -0500 | [diff] [blame] | 78 | optional_array = get_option('optional-images') |
| 79 | optional_images = '' |
| 80 | foreach optiona_image : optional_array |
| 81 | optional_images = ' '.join([optional_images, optiona_image]) |
| 82 | endforeach |
| 83 | conf.set_quoted('OPTIONAL_IMAGES', optional_images) |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 84 | conf.set_quoted('PUBLICKEY_FILE_NAME', get_option('publickey-file-name')) |
| 85 | conf.set_quoted('SIGNATURE_FILE_EXT', get_option('signature-file-ext')) |
| 86 | conf.set_quoted('SIGNED_IMAGE_CONF_PATH', get_option('signed-image-conf-path')) |
| 87 | conf.set_quoted('SYNC_LIST_DIR_PATH', get_option('sync-list-dir-path')) |
| 88 | conf.set_quoted('SYNC_LIST_FILE_NAME', get_option('sync-list-file-name')) |
Miguel Gomez | 21dad04 | 2020-06-26 20:54:48 +0000 | [diff] [blame] | 89 | conf.set_quoted('BMC_MSL', get_option('bmc-msl')) |
| 90 | conf.set_quoted('REGEX_BMC_MSL', get_option('regex-bmc-msl')) |
| 91 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 92 | if get_option('host-bios-upgrade').allowed() |
Lei YU | 6e9fb1d | 2021-02-19 18:01:40 +0800 | [diff] [blame] | 93 | conf.set_quoted('BIOS_OBJPATH', get_option('bios-object-path')) |
| 94 | endif |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 95 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 96 | if get_option('bmc-static-dual-image').allowed() |
| 97 | conf.set('BMC_STATIC_DUAL_IMAGE', get_option('bmc-static-dual-image').allowed()) |
Lei YU | 6376964 | 2021-12-10 16:15:04 +0800 | [diff] [blame] | 98 | conf.set_quoted('ALT_ROFS_DIR', get_option('alt-rofs-dir')) |
Lei YU | cc9b41a | 2021-12-15 14:07:16 +0800 | [diff] [blame] | 99 | conf.set_quoted('ALT_RWFS', get_option('alt-rwfs-dir')) |
| 100 | else |
| 101 | conf.set_quoted('ALT_RWFS', '/media/alt/var/persist') |
Lei YU | 6376964 | 2021-12-10 16:15:04 +0800 | [diff] [blame] | 102 | endif |
| 103 | |
Adriana Kobylak | 0af80a4 | 2020-05-05 13:32:10 -0500 | [diff] [blame] | 104 | configure_file(output: 'config.h', configuration: conf) |
Adriana Kobylak | 113492e | 2020-05-05 13:45:45 -0500 | [diff] [blame] | 105 | |
Konstantin Aladyshev | fa34e22 | 2024-04-02 17:12:40 +0300 | [diff] [blame] | 106 | boost_dep = dependency('boost') |
| 107 | |
Patrick Williams | c026f6c | 2022-03-21 09:37:14 -0500 | [diff] [blame] | 108 | sdbusplus_dep = dependency('sdbusplus') |
| 109 | sdbusplusplus_prog = find_program('sdbus++', native: true) |
| 110 | sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true) |
Patrick Williams | 4026702 | 2021-08-26 16:48:42 -0500 | [diff] [blame] | 111 | |
Patrick Williams | c026f6c | 2022-03-21 09:37:14 -0500 | [diff] [blame] | 112 | pdi_dep = dependency('phosphor-dbus-interfaces') |
| 113 | phosphor_logging_dep = dependency('phosphor-logging') |
Patrick Williams | 4026702 | 2021-08-26 16:48:42 -0500 | [diff] [blame] | 114 | |
| 115 | cereal_dep = dependency('cereal', required: false) |
| 116 | has_cereal = cpp.has_header_symbol( |
| 117 | 'cereal/cereal.hpp', |
| 118 | 'cereal::specialize', |
| 119 | dependencies: cereal_dep, |
| 120 | required: false) |
| 121 | if not has_cereal |
| 122 | cereal_opts = import('cmake').subproject_options() |
Konstantin Aladyshev | d2d57bb | 2024-04-02 17:05:10 +0300 | [diff] [blame] | 123 | cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'}) |
Patrick Williams | 4026702 | 2021-08-26 16:48:42 -0500 | [diff] [blame] | 124 | cereal_proj = import('cmake').subproject( |
| 125 | 'cereal', |
| 126 | options: cereal_opts, |
| 127 | required: false) |
| 128 | assert(cereal_proj.found(), 'cereal is required') |
| 129 | cereal_dep = cereal_proj.dependency('cereal') |
| 130 | endif |
| 131 | |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 132 | deps = [ |
Patrick Williams | 4026702 | 2021-08-26 16:48:42 -0500 | [diff] [blame] | 133 | cereal_dep, |
Patrick Williams | c026f6c | 2022-03-21 09:37:14 -0500 | [diff] [blame] | 134 | pdi_dep, |
| 135 | phosphor_logging_dep, |
| 136 | sdbusplus_dep, |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 137 | ] |
| 138 | |
| 139 | ssl = dependency('openssl') |
| 140 | |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 141 | systemd = dependency('systemd') |
Patrick Williams | e80b5bc | 2023-04-12 08:01:05 -0500 | [diff] [blame] | 142 | systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir') |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 143 | |
| 144 | unit_files = [ |
Adriana Kobylak | 436be81 | 2020-06-17 09:44:56 -0500 | [diff] [blame] | 145 | 'obmc-flash-bmc-setenv@.service.in', |
| 146 | 'reboot-guard-disable.service.in', |
| 147 | 'reboot-guard-enable.service.in', |
| 148 | 'force-reboot.service.in', |
| 149 | 'usr-local.mount.in', |
| 150 | 'xyz.openbmc_project.Software.BMC.Updater.service.in', |
| 151 | 'xyz.openbmc_project.Software.Download.service.in', |
| 152 | 'xyz.openbmc_project.Software.Sync.service.in', |
| 153 | 'xyz.openbmc_project.Software.Version.service.in' |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 154 | ] |
| 155 | |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 156 | image_updater_sources = files( |
| 157 | 'activation.cpp', |
Adriana Kobylak | 73609bb | 2020-06-18 15:05:40 -0500 | [diff] [blame] | 158 | 'images.cpp', |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 159 | 'item_updater.cpp', |
| 160 | 'item_updater_main.cpp', |
| 161 | 'serialize.cpp', |
| 162 | 'version.cpp', |
Miguel Gomez | 21dad04 | 2020-06-26 20:54:48 +0000 | [diff] [blame] | 163 | 'utils.cpp', |
| 164 | 'msl_verify.cpp' |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 165 | ) |
| 166 | |
| 167 | if get_option('bmc-layout').contains('static') |
Adriana Kobylak | 436be81 | 2020-06-17 09:44:56 -0500 | [diff] [blame] | 168 | image_updater_sources += files( |
| 169 | 'static/flash.cpp', |
| 170 | 'static/item_updater_helper.cpp' |
| 171 | ) |
Adriana Kobylak | 86013f3 | 2020-05-13 12:12:38 -0500 | [diff] [blame] | 172 | elif get_option('bmc-layout').contains('ubi') |
Adriana Kobylak | 436be81 | 2020-06-17 09:44:56 -0500 | [diff] [blame] | 173 | image_updater_sources += files( |
| 174 | 'ubi/flash.cpp', |
| 175 | 'ubi/item_updater_helper.cpp' |
| 176 | ) |
| 177 | |
| 178 | unit_files += [ |
| 179 | 'ubi/obmc-flash-bmc-cleanup.service.in', |
| 180 | 'ubi/obmc-flash-bmc-mirroruboot.service.in', |
| 181 | 'ubi/obmc-flash-bmc-ubiremount.service.in', |
| 182 | 'ubi/obmc-flash-bmc-ubiro@.service.in', |
| 183 | 'ubi/obmc-flash-bmc-ubiro-remove@.service.in', |
| 184 | 'ubi/obmc-flash-bmc-ubirw.service.in', |
| 185 | 'ubi/obmc-flash-bmc-ubirw-remove.service.in', |
| 186 | 'ubi/obmc-flash-bmc-updateubootvars@.service.in' |
| 187 | ] |
Adriana Kobylak | 86013f3 | 2020-05-13 12:12:38 -0500 | [diff] [blame] | 188 | elif get_option('bmc-layout').contains('mmc') |
Adriana Kobylak | 436be81 | 2020-06-17 09:44:56 -0500 | [diff] [blame] | 189 | image_updater_sources += files( |
| 190 | 'mmc/flash.cpp', |
| 191 | 'mmc/item_updater_helper.cpp' |
| 192 | ) |
Adriana Kobylak | 70f5bc0 | 2020-05-13 14:08:14 -0500 | [diff] [blame] | 193 | |
| 194 | unit_files += [ |
| 195 | 'mmc/obmc-flash-mmc@.service.in', |
Adriana Kobylak | d7fbc1e | 2020-06-06 07:46:40 -0500 | [diff] [blame] | 196 | 'mmc/obmc-flash-mmc-mount.service.in', |
Adriana Kobylak | 70f5bc0 | 2020-05-13 14:08:14 -0500 | [diff] [blame] | 197 | 'mmc/obmc-flash-mmc-remove@.service.in', |
Adriana Kobylak | 3412435 | 2020-05-22 09:40:40 -0500 | [diff] [blame] | 198 | 'mmc/obmc-flash-mmc-setprimary@.service.in', |
Adriana Kobylak | d7fbc1e | 2020-06-06 07:46:40 -0500 | [diff] [blame] | 199 | 'mmc/obmc-flash-mmc-umount.service.in', |
Lakshmi Yadlapati | 87c5b5b | 2022-11-15 18:14:12 -0600 | [diff] [blame] | 200 | 'mmc/obmc-flash-mmc-mirroruboot.service.in', |
Adriana Kobylak | 70f5bc0 | 2020-05-13 14:08:14 -0500 | [diff] [blame] | 201 | ] |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 202 | endif |
| 203 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 204 | if get_option('host-bios-upgrade').allowed() |
Adriana Kobylak | 436be81 | 2020-06-17 09:44:56 -0500 | [diff] [blame] | 205 | unit_files += 'obmc-flash-host-bios@.service.in' |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 206 | endif |
| 207 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 208 | if get_option('bmc-static-dual-image').allowed() |
Lei YU | 8474967 | 2021-12-15 14:31:10 +0800 | [diff] [blame] | 209 | unit_files += [ |
Lei YU | 554757b | 2022-03-21 11:05:50 +0800 | [diff] [blame] | 210 | 'static/obmc-flash-bmc-alt@.service.in', |
Lei YU | 8474967 | 2021-12-15 14:31:10 +0800 | [diff] [blame] | 211 | 'static/obmc-flash-bmc-static-mount-alt.service.in', |
| 212 | 'static/obmc-flash-bmc-prepare-for-sync.service.in', |
| 213 | ] |
Lei YU | 6376964 | 2021-12-10 16:15:04 +0800 | [diff] [blame] | 214 | endif |
| 215 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 216 | if get_option('sync-bmc-files').allowed() |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 217 | executable( |
| 218 | 'phosphor-sync-software-manager', |
| 219 | 'sync_manager.cpp', |
| 220 | 'sync_manager_main.cpp', |
| 221 | 'sync_watch.cpp', |
| 222 | dependencies: deps, |
| 223 | install: true |
| 224 | ) |
Adriana Kobylak | 817209f | 2020-05-07 09:52:03 -0500 | [diff] [blame] | 225 | |
| 226 | install_data('synclist', |
| 227 | install_dir: get_option('sysconfdir') |
| 228 | ) |
Lei YU | 8474967 | 2021-12-15 14:31:10 +0800 | [diff] [blame] | 229 | |
| 230 | install_data('sync-once.sh', |
| 231 | install_mode: 'rwxr-xr-x', |
| 232 | install_dir: get_option('bindir') |
| 233 | ) |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 234 | endif |
| 235 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 236 | if (get_option('verify-signature').allowed()) |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 237 | image_updater_sources += files( |
George Liu | 0a06e97 | 2020-12-17 09:17:04 +0800 | [diff] [blame] | 238 | 'utils.cpp', |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 239 | 'image_verify.cpp', |
| 240 | 'openssl_alloc.cpp' |
| 241 | ) |
| 242 | endif |
| 243 | |
| 244 | executable( |
| 245 | 'phosphor-download-manager', |
| 246 | 'download_manager.cpp', |
| 247 | 'download_manager_main.cpp', |
| 248 | dependencies: deps, |
| 249 | install: true |
| 250 | ) |
| 251 | |
| 252 | executable( |
| 253 | 'phosphor-image-updater', |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 254 | image_updater_sources, |
Konstantin Aladyshev | fa34e22 | 2024-04-02 17:12:40 +0300 | [diff] [blame] | 255 | dependencies: [deps, ssl, boost_dep], |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 256 | install: true |
| 257 | ) |
| 258 | |
| 259 | executable( |
| 260 | 'phosphor-version-software-manager', |
Adriana Kobylak | e0aa780 | 2020-05-05 13:54:49 -0500 | [diff] [blame] | 261 | 'image_manager.cpp', |
| 262 | 'image_manager_main.cpp', |
| 263 | 'version.cpp', |
| 264 | 'watch.cpp', |
| 265 | dependencies: [deps, ssl], |
| 266 | install: true |
| 267 | ) |
Adriana Kobylak | 817209f | 2020-05-07 09:52:03 -0500 | [diff] [blame] | 268 | |
| 269 | install_data('obmc-flash-bmc', |
| 270 | install_mode: 'rwxr-xr-x', |
| 271 | install_dir: get_option('bindir') |
| 272 | ) |
| 273 | |
Lei YU | 531fbc2 | 2021-12-10 20:03:18 +0800 | [diff] [blame] | 274 | install_data('detect-slot-aspeed', |
| 275 | install_mode: 'rwxr-xr-x', |
| 276 | install_dir: get_option('bindir') |
| 277 | ) |
| 278 | |
Lei YU | 984cef5 | 2021-12-17 11:28:21 +0800 | [diff] [blame] | 279 | install_data('reset-cs0-aspeed', |
| 280 | install_mode: 'rwxr-xr-x', |
| 281 | install_dir: get_option('bindir') |
| 282 | ) |
| 283 | |
Adriana Kobylak | 817209f | 2020-05-07 09:52:03 -0500 | [diff] [blame] | 284 | install_data('software.conf', |
| 285 | install_dir: '/usr/lib/tmpfiles.d/' |
| 286 | ) |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 287 | |
| 288 | foreach u : unit_files |
| 289 | configure_file( |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 290 | input: u, |
Adriana Kobylak | 436be81 | 2020-06-17 09:44:56 -0500 | [diff] [blame] | 291 | output: '@BASENAME@', |
| 292 | configuration: conf, |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 293 | install: true, |
| 294 | install_dir: systemd_system_unit_dir, |
Adriana Kobylak | 29a0d90 | 2020-05-05 13:59:49 -0500 | [diff] [blame] | 295 | ) |
| 296 | endforeach |
Adriana Kobylak | 78e72d9 | 2020-05-05 14:01:54 -0500 | [diff] [blame] | 297 | |
| 298 | # If test coverage of source files within the root directory are wanted, |
| 299 | # need to define and build the tests from here |
| 300 | build_tests = get_option('tests') |
| 301 | if not build_tests.disabled() |
Adriana Kobylak | 78e72d9 | 2020-05-05 14:01:54 -0500 | [diff] [blame] | 302 | gtest = dependency('gtest', main: true, disabler: true, required: build_tests) |
| 303 | include_srcs = declare_dependency(sources: [ |
George Liu | 0a06e97 | 2020-12-17 09:17:04 +0800 | [diff] [blame] | 304 | 'utils.cpp', |
Adriana Kobylak | 78e72d9 | 2020-05-05 14:01:54 -0500 | [diff] [blame] | 305 | 'image_verify.cpp', |
Adriana Kobylak | 73609bb | 2020-06-18 15:05:40 -0500 | [diff] [blame] | 306 | 'images.cpp', |
Adriana Kobylak | 78e72d9 | 2020-05-05 14:01:54 -0500 | [diff] [blame] | 307 | 'version.cpp'] |
| 308 | ) |
| 309 | |
| 310 | test('utest', |
| 311 | executable( |
| 312 | 'utest', |
| 313 | './test/utest.cpp', |
Adriana Kobylak | 78e72d9 | 2020-05-05 14:01:54 -0500 | [diff] [blame] | 314 | dependencies: [deps, gtest, include_srcs, ssl] |
| 315 | ) |
| 316 | ) |
| 317 | endif |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 318 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 319 | if get_option('usb-code-update').allowed() |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 320 | subdir('usb') |
| 321 | endif |
Andrew Geissler | 70d72f8 | 2022-03-23 13:15:05 -0500 | [diff] [blame] | 322 | |
Patrick Williams | 83d7d40 | 2023-11-29 06:43:55 -0600 | [diff] [blame] | 323 | if get_option('side-switch-on-boot').allowed() |
Andrew Geissler | 70d72f8 | 2022-03-23 13:15:05 -0500 | [diff] [blame] | 324 | subdir('side-switch') |
| 325 | endif |