SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 1 | project( |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 2 | 'vpd-manager', |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 3 | 'c', |
| 4 | 'cpp', |
| 5 | default_options: [ |
Priyanga Ramasamy | 9d14934 | 2020-07-16 23:41:26 +0530 | [diff] [blame] | 6 | 'warning_level=3', |
| 7 | 'werror=true', |
Patrick Williams | 13d4200 | 2025-02-04 06:44:15 -0500 | [diff] [blame^] | 8 | 'cpp_std=c++23', |
PriyangaRamasamy | f272efc | 2021-03-03 23:24:31 -0600 | [diff] [blame] | 9 | 'buildtype=debugoptimized' |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 10 | ], |
Patrick Williams | 8e532c1 | 2021-10-06 15:34:56 -0500 | [diff] [blame] | 11 | version: '1.0', |
Patrick Williams | 13d4200 | 2025-02-04 06:44:15 -0500 | [diff] [blame^] | 12 | meson_version: '>=1.1.1', |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 13 | ) |
| 14 | |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 15 | add_global_arguments('-Wno-psabi', '-Wno-ignored-attributes', language : ['c', 'cpp']) |
Andrew Jeffery | 3aec478 | 2021-06-15 11:45:23 +0930 | [diff] [blame] | 16 | |
Andrew Jeffery | f395376 | 2021-06-15 11:10:10 +0930 | [diff] [blame] | 17 | # Disable FORTIFY_SOURCE when compiling with no optimization |
| 18 | if(get_option('optimization') == '0') |
| 19 | add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c']) |
| 20 | message('Disabling FORTIFY_SOURCE as optimization is set to 0') |
| 21 | endif |
| 22 | |
| 23 | # Setup googletest before we import any projects that also depend on it to make |
| 24 | # sure we have control over its configuration |
| 25 | build_tests = get_option('tests') |
Andrew Jeffery | 60b5bd2 | 2021-06-15 10:41:28 +0930 | [diff] [blame] | 26 | |
| 27 | sdbusplus = dependency('sdbusplus', fallback: [ 'sdbusplus', 'sdbusplus_dep' ]) |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 28 | phosphor_logging = dependency('phosphor-logging') |
| 29 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 30 | |
Patrick Williams | f2e017d | 2025-01-30 17:47:50 -0500 | [diff] [blame] | 31 | if build_tests.allowed() |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 32 | subdir('test') |
| 33 | endif |
| 34 | |
| 35 | subdir('vpd-tool') |
| 36 | |
| 37 | compiler = meson.get_compiler('cpp') |
| 38 | |
| 39 | conf_data = configuration_data() |
| 40 | conf_data.set_quoted('BUSNAME', get_option('BUSNAME')) |
| 41 | conf_data.set_quoted('OBJPATH', get_option('OBJPATH')) |
| 42 | conf_data.set_quoted('IFACE', get_option('IFACE')) |
| 43 | conf_data.set_quoted('BAD_VPD_DIR', get_option('BAD_VPD_DIR')) |
| 44 | conf_data.set_quoted('INVENTORY_JSON_DEFAULT', get_option('INVENTORY_JSON_DEFAULT')) |
| 45 | conf_data.set_quoted('INVENTORY_JSON_SYM_LINK', get_option('INVENTORY_JSON_SYM_LINK')) |
| 46 | conf_data.set_quoted('JSON_ABSOLUTE_PATH_PREFIX', get_option('JSON_ABSOLUTE_PATH_PREFIX')) |
| 47 | conf_data.set_quoted('SYSTEM_VPD_FILE_PATH', get_option('SYSTEM_VPD_FILE_PATH')) |
| 48 | conf_data.set_quoted('VPD_SYMLIMK_PATH', get_option('VPD_SYMLIMK_PATH')) |
| 49 | conf_data.set_quoted('PIM_PATH_PREFIX', get_option('PIM_PATH_PREFIX')) |
| 50 | configure_file(output: 'config.h', |
| 51 | configuration : conf_data) |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 52 | |
Priyanga Ramasamy | a4a2adf | 2022-02-03 05:43:41 -0600 | [diff] [blame] | 53 | libvpdecc_src = files( |
| 54 | 'vpdecc/vpdecc.c', |
| 55 | 'vpdecc/vpdecc_support.c' |
| 56 | ) |
| 57 | |
| 58 | libvpdecc = shared_library( |
| 59 | 'vpdecc', |
| 60 | libvpdecc_src, |
| 61 | version: meson.project_version(), |
| 62 | install: true, |
| 63 | ) |
| 64 | |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 65 | libgpiodcxx = dependency( |
Patrick Williams | abe481e | 2023-09-07 05:47:20 -0500 | [diff] [blame] | 66 | 'libgpiodcxx', |
| 67 | default_options: ['bindings=cxx'], |
| 68 | ) |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 69 | |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 70 | subdir('vpd-manager') |
Kantesh Nagaradder | 38ee9c8 | 2023-04-07 00:58:12 -0500 | [diff] [blame] | 71 | |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 72 | services = ['service_files/vpd-manager.service', |
| 73 | 'service_files/system-vpd.service', |
| 74 | 'service_files/wait-vpd-parsers.service'] |
| 75 | |
Alpana Kumari | b48e6ff | 2022-04-24 23:42:28 -0500 | [diff] [blame] | 76 | systemd_system_unit_dir = dependency('systemd').get_variable( |
Patrick Williams | c68829a | 2023-04-12 08:01:19 -0500 | [diff] [blame] | 77 | 'systemdsystemunitdir') |
Priyanga Ramasamy | 29fbea9 | 2023-10-04 01:28:10 -0500 | [diff] [blame] | 78 | install_data(services, install_dir: systemd_system_unit_dir) |
Alpana Kumari | b48e6ff | 2022-04-24 23:42:28 -0500 | [diff] [blame] | 79 | |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 80 | scripts = ['scripts/wait-vpd-status.sh'] |
Priyanga Ramasamy | 29fbea9 | 2023-10-04 01:28:10 -0500 | [diff] [blame] | 81 | |
| 82 | install_data(scripts, |
Alpana Kumari | b48e6ff | 2022-04-24 23:42:28 -0500 | [diff] [blame] | 83 | install_mode: 'rwxr-xr-x', |
| 84 | install_dir: get_option('bindir')) |
| 85 | |
Alpana Kumari | b48e6ff | 2022-04-24 23:42:28 -0500 | [diff] [blame] | 86 | package_datadir = join_paths('share', 'vpd') |
Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 87 | install_subdir('configuration/ibm/', install_mode: 'rwxr-xr-x', install_dir: package_datadir, strip_directory: true) |