Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 1 | project( |
| 2 | 'phosphor-psu-code-mgmt', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
| 5 | meson_version: '>=1.1.1', |
| 6 | default_options: [ |
| 7 | 'warning_level=3', |
| 8 | 'werror=true', |
| 9 | 'cpp_std=c++23', |
| 10 | 'b_lto=true', |
| 11 | ], |
| 12 | ) |
Lei YU | e065f61 | 2019-07-30 14:10:52 +0800 | [diff] [blame] | 13 | |
| 14 | systemd = dependency('systemd') |
Patrick Williams | 200adf8 | 2023-04-12 08:01:16 -0500 | [diff] [blame] | 15 | servicedir = systemd.get_variable('systemdsystemunitdir') |
Lei YU | 617c0b7 | 2020-02-10 16:11:47 +0800 | [diff] [blame] | 16 | subdir('services') |
Lei YU | e065f61 | 2019-07-30 14:10:52 +0800 | [diff] [blame] | 17 | |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 18 | # Common configurations for src and test |
| 19 | cdata = configuration_data() |
Lei YU | ad90ad5 | 2019-08-06 11:19:28 +0800 | [diff] [blame] | 20 | cdata.set_quoted('ITEM_IFACE', 'xyz.openbmc_project.Inventory.Item') |
Lei YU | 9edb733 | 2019-09-19 14:46:19 +0800 | [diff] [blame] | 21 | cdata.set_quoted('ASSET_IFACE', 'xyz.openbmc_project.Inventory.Decorator.Asset') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 22 | cdata.set_quoted('VERSION_IFACE', 'xyz.openbmc_project.Software.Version') |
| 23 | cdata.set_quoted('FILEPATH_IFACE', 'xyz.openbmc_project.Common.FilePath') |
| 24 | cdata.set_quoted('BUSNAME_UPDATER', 'xyz.openbmc_project.Software.Psu.Updater') |
Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 25 | cdata.set_quoted( |
| 26 | 'PSU_INVENTORY_IFACE', |
| 27 | 'xyz.openbmc_project.Inventory.Item.PowerSupply', |
| 28 | ) |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 29 | cdata.set_quoted('ACTIVATION_FWD_ASSOCIATION', 'inventory') |
| 30 | cdata.set_quoted('ACTIVATION_REV_ASSOCIATION', 'activation') |
| 31 | cdata.set_quoted('ACTIVE_FWD_ASSOCIATION', 'active') |
| 32 | cdata.set_quoted('ACTIVE_REV_ASSOCIATION', 'software_version') |
| 33 | cdata.set_quoted('FUNCTIONAL_FWD_ASSOCIATION', 'functional') |
| 34 | cdata.set_quoted('FUNCTIONAL_REV_ASSOCIATION', 'software_version') |
Lei YU | a8b966f | 2020-03-18 10:32:24 +0800 | [diff] [blame] | 35 | cdata.set_quoted('UPDATEABLE_FWD_ASSOCIATION', 'updateable') |
| 36 | cdata.set_quoted('UPDATEABLE_REV_ASSOCIATION', 'software_version') |
Lei YU | f77189f | 2019-08-07 14:26:30 +0800 | [diff] [blame] | 37 | cdata.set_quoted('VERSION', 'Version') |
| 38 | cdata.set_quoted('PRESENT', 'Present') |
Lei YU | 9edb733 | 2019-09-19 14:46:19 +0800 | [diff] [blame] | 39 | cdata.set_quoted('MANUFACTURER', 'Manufacturer') |
| 40 | cdata.set_quoted('MODEL', 'Model') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 41 | |
| 42 | cdata.set_quoted('SOFTWARE_OBJPATH', get_option('SOFTWARE_OBJPATH')) |
| 43 | cdata.set_quoted('MANIFEST_FILE', get_option('MANIFEST_FILE')) |
Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 44 | cdata.set_quoted( |
| 45 | 'PSU_INVENTORY_PATH_BASE', |
| 46 | get_option('PSU_INVENTORY_PATH_BASE'), |
| 47 | ) |
Lei YU | 5f3584d | 2019-08-27 16:28:53 +0800 | [diff] [blame] | 48 | cdata.set_quoted('PSU_VERSION_UTIL', get_option('PSU_VERSION_UTIL')) |
Shawn McCarney | 783406e | 2024-11-17 21:49:37 -0600 | [diff] [blame] | 49 | cdata.set_quoted('PSU_MODEL_UTIL', get_option('PSU_MODEL_UTIL')) |
Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 50 | cdata.set_quoted( |
| 51 | 'PSU_VERSION_COMPARE_UTIL', |
| 52 | get_option('PSU_VERSION_COMPARE_UTIL'), |
| 53 | ) |
Lei YU | 12c9f4c | 2019-09-11 15:08:15 +0800 | [diff] [blame] | 54 | cdata.set_quoted('PSU_UPDATE_SERVICE', get_option('PSU_UPDATE_SERVICE')) |
| 55 | cdata.set_quoted('IMG_DIR', get_option('IMG_DIR')) |
Lei YU | 2e0e2de | 2019-09-26 16:42:23 +0800 | [diff] [blame] | 56 | cdata.set_quoted('IMG_DIR_PERSIST', get_option('IMG_DIR_PERSIST')) |
| 57 | cdata.set_quoted('IMG_DIR_BUILTIN', get_option('IMG_DIR_BUILTIN')) |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 58 | |
Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 59 | cdata.set10( |
| 60 | 'ALWAYS_USE_BUILTIN_IMG_DIR', |
| 61 | get_option('ALWAYS_USE_BUILTIN_IMG_DIR'), |
| 62 | ) |
Faisal Awada | fb86e79 | 2024-09-11 10:51:17 -0500 | [diff] [blame] | 63 | |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 64 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 65 | phosphor_logging = dependency('phosphor-logging') |
| 66 | sdbusplus = dependency('sdbusplus') |
Lei YU | ad90ad5 | 2019-08-06 11:19:28 +0800 | [diff] [blame] | 67 | ssl = dependency('openssl') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 68 | |
Lei YU | e065f61 | 2019-07-30 14:10:52 +0800 | [diff] [blame] | 69 | subdir('src') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 70 | |
| 71 | build_tests = get_option('tests') |
Lei YU | 5f3584d | 2019-08-27 16:28:53 +0800 | [diff] [blame] | 72 | build_examples = get_option('examples') |
| 73 | |
| 74 | if build_examples |
Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 75 | subdir('vendor-example') |
Lei YU | 5f3584d | 2019-08-27 16:28:53 +0800 | [diff] [blame] | 76 | endif |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 77 | |
| 78 | if not build_tests.disabled() |
Patrick Williams | 8a08ac1 | 2025-02-01 08:37:15 -0500 | [diff] [blame^] | 79 | subdir('test') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 80 | endif |