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