blob: 238a82cac17c7fcb25fc43c423c0b308167800b5 [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',
Patrick Williams13d42002025-02-04 06:44:15 -05008 'cpp_std=c++23',
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',
Patrick Williams13d42002025-02-04 06:44:15 -050012 meson_version: '>=1.1.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
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050035compiler = meson.get_compiler('cpp')
36
37conf_data = configuration_data()
38conf_data.set_quoted('BUSNAME', get_option('BUSNAME'))
39conf_data.set_quoted('OBJPATH', get_option('OBJPATH'))
40conf_data.set_quoted('IFACE', get_option('IFACE'))
41conf_data.set_quoted('BAD_VPD_DIR', get_option('BAD_VPD_DIR'))
42conf_data.set_quoted('INVENTORY_JSON_DEFAULT', get_option('INVENTORY_JSON_DEFAULT'))
43conf_data.set_quoted('INVENTORY_JSON_SYM_LINK', get_option('INVENTORY_JSON_SYM_LINK'))
44conf_data.set_quoted('JSON_ABSOLUTE_PATH_PREFIX', get_option('JSON_ABSOLUTE_PATH_PREFIX'))
45conf_data.set_quoted('SYSTEM_VPD_FILE_PATH', get_option('SYSTEM_VPD_FILE_PATH'))
46conf_data.set_quoted('VPD_SYMLIMK_PATH', get_option('VPD_SYMLIMK_PATH'))
47conf_data.set_quoted('PIM_PATH_PREFIX', get_option('PIM_PATH_PREFIX'))
48configure_file(output: 'config.h',
49 configuration : conf_data)
SunnySrivastava19847ef54422019-12-03 02:47:37 -060050
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053051services = ['service_files/vpd-manager.service']
Priyanga Ramasamya4a2adf2022-02-03 05:43:41 -060052
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053053if get_option('ibm_system').allowed()
54 subdir('vpd-tool')
55 scripts = ['scripts/wait-vpd-status.sh']
56
57 install_data(scripts,
58 install_mode: 'rwxr-xr-x',
59 install_dir: get_option('bindir'))
60
61 services += ['service_files/system-vpd.service',
62 'service_files/wait-vpd-parsers.service']
63
64 package_datadir = join_paths('share', 'vpd')
65 install_subdir('configuration/ibm/', install_mode: 'rwxr-xr-x', install_dir: package_datadir, strip_directory: true)
66endif
Priyanga Ramasamya4a2adf2022-02-03 05:43:41 -060067
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050068libgpiodcxx = dependency(
Patrick Williamsabe481e2023-09-07 05:47:20 -050069 'libgpiodcxx',
70 default_options: ['bindings=cxx'],
71 )
SunnySrivastava19847ef54422019-12-03 02:47:37 -060072
Sunny Srivastavadfdd4b12025-02-25 12:41:46 +053073libvpdecc_src = files(
74 'vpdecc/vpdecc.c',
75 'vpdecc/vpdecc_support.c'
76 )
77
78 libvpdecc = shared_library(
79 'vpdecc',
80 libvpdecc_src,
81 version: meson.project_version(),
82 install: true,
83 )
84
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050085subdir('vpd-manager')
Kantesh Nagaradder38ee9c82023-04-07 00:58:12 -050086
Alpana Kumarib48e6ff2022-04-24 23:42:28 -050087systemd_system_unit_dir = dependency('systemd').get_variable(
Patrick Williamsc68829a2023-04-12 08:01:19 -050088 'systemdsystemunitdir')
Priyanga Ramasamy29fbea92023-10-04 01:28:10 -050089install_data(services, install_dir: systemd_system_unit_dir)