blob: 968a6ad92c5e127df850cfa879f4f6cb28838d3a [file] [log] [blame]
SunnySrivastava19847ef54422019-12-03 02:47:37 -06001project(
Anupama B R31c04112025-02-27 02:34:26 -06002 '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',
SunnySrivastava19847ef54422019-12-03 02:47:37 -060013)
14
Anupama B R31c04112025-02-27 02:34:26 -060015add_global_arguments(
16 '-Wno-psabi',
17 '-Wno-ignored-attributes',
18 language: ['c', 'cpp'],
19)
Andrew Jeffery3aec4782021-06-15 11:45:23 +093020
Andrew Jefferyf3953762021-06-15 11:10:10 +093021# Disable FORTIFY_SOURCE when compiling with no optimization
Anupama B R31c04112025-02-27 02:34:26 -060022if (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 Jefferyf3953762021-06-15 11:10:10 +093025endif
26
27# Setup googletest before we import any projects that also depend on it to make
28# sure we have control over its configuration
29build_tests = get_option('tests')
Andrew Jeffery60b5bd22021-06-15 10:41:28 +093030
Anupama B R31c04112025-02-27 02:34:26 -060031sdbusplus = dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep'])
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050032phosphor_logging = dependency('phosphor-logging')
33phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
34
Patrick Williamsf2e017d2025-01-30 17:47:50 -050035if build_tests.allowed()
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050036 subdir('test')
37endif
38
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050039compiler = meson.get_compiler('cpp')
40
41conf_data = configuration_data()
42conf_data.set_quoted('BUSNAME', get_option('BUSNAME'))
43conf_data.set_quoted('OBJPATH', get_option('OBJPATH'))
44conf_data.set_quoted('IFACE', get_option('IFACE'))
Anupama B R31c04112025-02-27 02:34:26 -060045conf_data.set_quoted(
46 'INVENTORY_JSON_DEFAULT',
47 get_option('INVENTORY_JSON_DEFAULT'),
48)
49conf_data.set_quoted(
50 'INVENTORY_JSON_SYM_LINK',
51 get_option('INVENTORY_JSON_SYM_LINK'),
52)
53conf_data.set_quoted(
54 'JSON_ABSOLUTE_PATH_PREFIX',
55 get_option('JSON_ABSOLUTE_PATH_PREFIX'),
56)
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050057conf_data.set_quoted('SYSTEM_VPD_FILE_PATH', get_option('SYSTEM_VPD_FILE_PATH'))
58conf_data.set_quoted('VPD_SYMLIMK_PATH', get_option('VPD_SYMLIMK_PATH'))
59conf_data.set_quoted('PIM_PATH_PREFIX', get_option('PIM_PATH_PREFIX'))
Anupama B R31c04112025-02-27 02:34:26 -060060configure_file(output: 'config.h', configuration: conf_data)
SunnySrivastava19847ef54422019-12-03 02:47:37 -060061
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053062services = ['service_files/vpd-manager.service']
Priyanga Ramasamya4a2adf2022-02-03 05:43:41 -060063
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053064if get_option('ibm_system').allowed()
65 subdir('vpd-tool')
Souvik Roy3e1cb492025-08-06 06:26:04 +000066 subdir('wait-vpd-parser')
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053067
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053068
Anupama B R31c04112025-02-27 02:34:26 -060069 services += [
70 'service_files/system-vpd.service',
71 'service_files/wait-vpd-parsers.service',
72 ]
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053073
74 package_datadir = join_paths('share', 'vpd')
Anupama B R31c04112025-02-27 02:34:26 -060075 install_subdir(
76 'configuration/ibm/',
77 install_mode: 'rwxr-xr-x',
78 install_dir: package_datadir,
79 strip_directory: true,
80 )
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053081endif
Priyanga Ramasamya4a2adf2022-02-03 05:43:41 -060082
Souvik Roy115652e2025-07-25 04:35:33 -050083libgpiodcxx = dependency(
84 'libgpiodcxx',
85 default_options: ['bindings=cxx'],
86 version: '<1.7.0',
87)
SunnySrivastava19847ef54422019-12-03 02:47:37 -060088
Anupama B R31c04112025-02-27 02:34:26 -060089libvpdecc_src = files('vpdecc/vpdecc.c', 'vpdecc/vpdecc_support.c')
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053090
Anupama B R31c04112025-02-27 02:34:26 -060091libvpdecc = shared_library(
92 'vpdecc',
93 libvpdecc_src,
94 version: meson.project_version(),
95 install: true,
96)
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053097
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050098subdir('vpd-manager')
Kantesh Nagaradder38ee9c82023-04-07 00:58:12 -050099
Alpana Kumarib48e6ff2022-04-24 23:42:28 -0500100systemd_system_unit_dir = dependency('systemd').get_variable(
Patrick Williams01285ad2025-07-09 11:27:17 -0400101 'systemd_system_unit_dir',
Anupama B R31c04112025-02-27 02:34:26 -0600102)
Priyanga Ramasamy29fbea92023-10-04 01:28:10 -0500103install_data(services, install_dir: systemd_system_unit_dir)