blob: 46d292f984fbfd2ca5e3096106ec4b59b71ff63b [file] [log] [blame]
SunnySrivastava19847ef54422019-12-03 02:47:37 -06001project(
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -05002 'vpd-manager',
SunnySrivastava19847ef54422019-12-03 02:47:37 -06003 'c',
4 'cpp',
5 default_options: [
Priyanga Ramasamy9d149342020-07-16 23:41:26 +05306 'warning_level=3',
7 'werror=true',
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -05008 'cpp_std=c++20',
PriyangaRamasamyf272efc2021-03-03 23:24:31 -06009 'buildtype=debugoptimized'
SunnySrivastava19847ef54422019-12-03 02:47:37 -060010 ],
Patrick Williams8e532c12021-10-06 15:34:56 -050011 version: '1.0',
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050012 meson_version: '>=0.58.1',
SunnySrivastava19847ef54422019-12-03 02:47:37 -060013)
14
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050015add_global_arguments('-Wno-psabi', '-Wno-ignored-attributes', language : ['c', 'cpp'])
Andrew Jeffery3aec4782021-06-15 11:45:23 +093016
Andrew Jefferyf3953762021-06-15 11:10:10 +093017# Disable FORTIFY_SOURCE when compiling with no optimization
18if(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')
21endif
22
23# Setup googletest before we import any projects that also depend on it to make
24# sure we have control over its configuration
25build_tests = get_option('tests')
Andrew Jeffery60b5bd22021-06-15 10:41:28 +093026
27sdbusplus = dependency('sdbusplus', fallback: [ 'sdbusplus', 'sdbusplus_dep' ])
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050028phosphor_logging = dependency('phosphor-logging')
29phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
30
Patrick Williamsf2e017d2025-01-30 17:47:50 -050031if build_tests.allowed()
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050032 subdir('test')
33endif
34
35subdir('vpd-tool')
36
37compiler = meson.get_compiler('cpp')
38
39conf_data = configuration_data()
40conf_data.set_quoted('BUSNAME', get_option('BUSNAME'))
41conf_data.set_quoted('OBJPATH', get_option('OBJPATH'))
42conf_data.set_quoted('IFACE', get_option('IFACE'))
43conf_data.set_quoted('BAD_VPD_DIR', get_option('BAD_VPD_DIR'))
44conf_data.set_quoted('INVENTORY_JSON_DEFAULT', get_option('INVENTORY_JSON_DEFAULT'))
45conf_data.set_quoted('INVENTORY_JSON_SYM_LINK', get_option('INVENTORY_JSON_SYM_LINK'))
46conf_data.set_quoted('JSON_ABSOLUTE_PATH_PREFIX', get_option('JSON_ABSOLUTE_PATH_PREFIX'))
47conf_data.set_quoted('SYSTEM_VPD_FILE_PATH', get_option('SYSTEM_VPD_FILE_PATH'))
48conf_data.set_quoted('VPD_SYMLIMK_PATH', get_option('VPD_SYMLIMK_PATH'))
49conf_data.set_quoted('PIM_PATH_PREFIX', get_option('PIM_PATH_PREFIX'))
50configure_file(output: 'config.h',
51 configuration : conf_data)
SunnySrivastava19847ef54422019-12-03 02:47:37 -060052
Priyanga Ramasamya4a2adf2022-02-03 05:43:41 -060053libvpdecc_src = files(
54 'vpdecc/vpdecc.c',
55 'vpdecc/vpdecc_support.c'
56)
57
58libvpdecc = shared_library(
59 'vpdecc',
60 libvpdecc_src,
61 version: meson.project_version(),
62 install: true,
63)
64
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050065libgpiodcxx = dependency(
Patrick Williamsabe481e2023-09-07 05:47:20 -050066 'libgpiodcxx',
67 default_options: ['bindings=cxx'],
68 )
SunnySrivastava19847ef54422019-12-03 02:47:37 -060069
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050070subdir('vpd-manager')
Kantesh Nagaradder38ee9c82023-04-07 00:58:12 -050071
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050072services = ['service_files/vpd-manager.service',
73 'service_files/system-vpd.service',
74 'service_files/wait-vpd-parsers.service']
75
Alpana Kumarib48e6ff2022-04-24 23:42:28 -050076systemd_system_unit_dir = dependency('systemd').get_variable(
Patrick Williamsc68829a2023-04-12 08:01:19 -050077 'systemdsystemunitdir')
Priyanga Ramasamy29fbea92023-10-04 01:28:10 -050078install_data(services, install_dir: systemd_system_unit_dir)
Alpana Kumarib48e6ff2022-04-24 23:42:28 -050079
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050080scripts = ['scripts/wait-vpd-status.sh']
Priyanga Ramasamy29fbea92023-10-04 01:28:10 -050081
82install_data(scripts,
Alpana Kumarib48e6ff2022-04-24 23:42:28 -050083 install_mode: 'rwxr-xr-x',
84 install_dir: get_option('bindir'))
85
Alpana Kumarib48e6ff2022-04-24 23:42:28 -050086package_datadir = join_paths('share', 'vpd')
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050087install_subdir('configuration/ibm/', install_mode: 'rwxr-xr-x', install_dir: package_datadir, strip_directory: true)