Lei YU | e065f61 | 2019-07-30 14:10:52 +0800 | [diff] [blame] | 1 | project('phosphor-psu-code-mgmt', 'cpp', |
| 2 | version: '0.1', meson_version: '>=0.49.0', |
| 3 | default_options: [ |
| 4 | 'warning_level=3', |
| 5 | 'werror=true', |
Lei YU | 01539e7 | 2019-07-31 10:57:38 +0800 | [diff] [blame] | 6 | 'cpp_std=c++17', |
| 7 | 'b_lto=true', |
Lei YU | e065f61 | 2019-07-30 14:10:52 +0800 | [diff] [blame] | 8 | ]) |
| 9 | |
| 10 | systemd = dependency('systemd') |
| 11 | servicedir = systemd.get_pkgconfig_variable('systemdsystemunitdir') |
| 12 | |
| 13 | configure_file(input: 'service/xyz.openbmc_project.Software.Psu.Updater.service', |
| 14 | output: 'xyz.openbmc_project.Software.Psu.Updater.service', |
| 15 | copy: true, |
| 16 | install_dir: servicedir) |
| 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') |
| 25 | cdata.set_quoted('PSU_INVENTORY_IFACE', 'xyz.openbmc_project.Inventory.Item.PowerSupply') |
| 26 | cdata.set_quoted('ACTIVATION_FWD_ASSOCIATION', 'inventory') |
| 27 | cdata.set_quoted('ACTIVATION_REV_ASSOCIATION', 'activation') |
| 28 | cdata.set_quoted('ACTIVE_FWD_ASSOCIATION', 'active') |
| 29 | cdata.set_quoted('ACTIVE_REV_ASSOCIATION', 'software_version') |
| 30 | cdata.set_quoted('FUNCTIONAL_FWD_ASSOCIATION', 'functional') |
| 31 | cdata.set_quoted('FUNCTIONAL_REV_ASSOCIATION', 'software_version') |
Lei YU | f77189f | 2019-08-07 14:26:30 +0800 | [diff] [blame] | 32 | cdata.set_quoted('VERSION', 'Version') |
| 33 | cdata.set_quoted('PRESENT', 'Present') |
Lei YU | 9edb733 | 2019-09-19 14:46:19 +0800 | [diff] [blame] | 34 | cdata.set_quoted('MANUFACTURER', 'Manufacturer') |
| 35 | cdata.set_quoted('MODEL', 'Model') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 36 | |
| 37 | cdata.set_quoted('SOFTWARE_OBJPATH', get_option('SOFTWARE_OBJPATH')) |
| 38 | cdata.set_quoted('MANIFEST_FILE', get_option('MANIFEST_FILE')) |
| 39 | cdata.set_quoted('PSU_INVENTORY_PATH_BASE', get_option('PSU_INVENTORY_PATH_BASE')) |
Lei YU | 5f3584d | 2019-08-27 16:28:53 +0800 | [diff] [blame] | 40 | cdata.set_quoted('PSU_VERSION_UTIL', get_option('PSU_VERSION_UTIL')) |
Lei YU | 12c9f4c | 2019-09-11 15:08:15 +0800 | [diff] [blame] | 41 | cdata.set_quoted('PSU_UPDATE_SERVICE', get_option('PSU_UPDATE_SERVICE')) |
| 42 | cdata.set_quoted('IMG_DIR', get_option('IMG_DIR')) |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 43 | |
| 44 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 45 | phosphor_logging = dependency('phosphor-logging') |
| 46 | sdbusplus = dependency('sdbusplus') |
Lei YU | ad90ad5 | 2019-08-06 11:19:28 +0800 | [diff] [blame] | 47 | ssl = dependency('openssl') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 48 | |
| 49 | add_project_link_arguments(['-lstdc++fs'], language: 'cpp') |
| 50 | |
Lei YU | e065f61 | 2019-07-30 14:10:52 +0800 | [diff] [blame] | 51 | subdir('src') |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 52 | |
| 53 | build_tests = get_option('tests') |
Lei YU | 5f3584d | 2019-08-27 16:28:53 +0800 | [diff] [blame] | 54 | build_examples = get_option('examples') |
| 55 | |
| 56 | if build_examples |
| 57 | subdir('vendor-example') |
| 58 | endif |
Lei YU | 5e0dcb3 | 2019-08-02 18:04:34 +0800 | [diff] [blame] | 59 | |
| 60 | if not build_tests.disabled() |
| 61 | subdir('test') |
| 62 | endif |