blob: c364a9e3ffde661266cc1fc2692ee1e68928ef9b [file] [log] [blame]
Brad Bishopb4459912019-11-05 19:39:11 -05001project(
2 'entity-manager',
3 'cpp',
Patrick Williams37304f02025-02-01 08:38:32 -05004 default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
Brad Bishopb4459912019-11-05 19:39:11 -05005 license: 'Apache-2.0',
6 version: '0.1',
Patrick Williams213b3972025-07-24 12:11:52 -04007 meson_version: '>=1.3.0',
Brad Bishopb4459912019-11-05 19:39:11 -05008)
Brad Bishopec984912020-10-01 10:24:55 -04009add_project_arguments('-Wno-psabi', language: 'cpp')
Brad Bishopb4459912019-11-05 19:39:11 -050010
11boost_args = [
Ed Tanousae2d4352025-02-12 15:51:48 -080012 '-DBOOST_ASIO_NO_DEPRECATED',
Brad Bishopb4459912019-11-05 19:39:11 -050013 '-DBOOST_SYSTEM_NO_DEPRECATED',
14 '-DBOOST_ERROR_CODE_HEADER_ONLY',
15 '-DBOOST_NO_RTTI',
16 '-DBOOST_NO_TYPEID',
17 '-DBOOST_ALL_NO_LIB',
Patrick Williams37304f02025-02-01 08:38:32 -050018 '-DBOOST_ALLOW_DEPRECATED_HEADERS',
Brad Bishopb4459912019-11-05 19:39:11 -050019]
Brad Bishope3a12b62020-01-15 11:56:29 -050020cpp = meson.get_compiler('cpp')
Brad Bishop787e8282020-01-15 12:16:53 -050021boost = dependency('boost', required: false)
22if not boost.found()
Patrick Williams37304f02025-02-01 08:38:32 -050023 subproject('boost', required: false)
Christopher Meis7cf43112025-07-15 09:09:02 +020024 boost = declare_dependency(include_directories: 'subprojects/boost_1_88_0')
Patrick Williams37304f02025-02-01 08:38:32 -050025 boost = boost.as_system('system')
Brad Bishop787e8282020-01-15 12:16:53 -050026endif
Brad Bishop92daaaa2020-01-20 15:45:01 -050027if get_option('fru-device')
28 i2c = cpp.find_library('i2c')
29endif
Andrew Jeffery14a7bc92021-08-02 10:01:22 +093030
Alexander Hansen8c4b1d92024-11-04 14:06:24 +010031if get_option('devicetree-vpd') or get_option('gpio-presence')
Patrick Williams37304f02025-02-01 08:38:32 -050032 phosphor_dbus_interfaces_dep = dependency(
33 'phosphor-dbus-interfaces',
34 include_type: 'system',
35 )
Chris Sides2ab73412024-10-15 16:04:11 -050036endif
37
Patrick Williams7e119822023-12-07 11:38:19 -060038nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
Patrick Williamsd909b2d2025-08-11 10:51:08 -040039sdbusplus = dependency('sdbusplus')
Alexander Hansenc3db2c32024-08-20 15:01:38 +020040phosphor_logging_dep = dependency('phosphor-logging')
Ed Tanous10c57652025-09-30 10:24:57 -070041zlib_dep = dependency('zlib', include_type: 'system')
42libxml2_dep = dependency('libxml-2.0', include_type: 'system')
Andrew Jeffery14a7bc92021-08-02 10:01:22 +093043
Alexander Hansen8c4b1d92024-11-04 14:06:24 +010044if get_option('gpio-presence') or get_option('tests').allowed()
Alexander Hansen7cf00d32025-07-24 15:53:31 +020045 libgpio_dep = dependency(
46 'libgpiodcxx',
47 default_options: ['bindings=cxx'],
48 version: '<1.7.0',
49 )
Alexander Hansen8c4b1d92024-11-04 14:06:24 +010050endif
51
Brad Bishopb4459912019-11-05 19:39:11 -050052systemd = dependency('systemd')
Patrick Williamsee1db762023-04-12 08:05:58 -050053systemd_system_unit_dir = systemd.get_variable(
Patrick Williams187d6ee2025-07-09 11:28:01 -040054 'systemd_system_unit_dir',
Patrick Williams37304f02025-02-01 08:38:32 -050055 pkgconfig_define: ['prefix', get_option('prefix')],
56)
Brad Bishopb4459912019-11-05 19:39:11 -050057packagedir = join_paths(
58 get_option('prefix'),
59 get_option('datadir'),
60 meson.project_name(),
61)
Andrew Jefferya9c58922021-06-01 09:28:59 +093062sysconfdir = join_paths(
63 get_option('prefix'),
64 get_option('sysconfdir'),
65 meson.project_name(),
66)
Brad Bishopb4459912019-11-05 19:39:11 -050067threads = dependency('threads')
Ed Tanous55ae5a82021-08-02 14:00:02 -070068if cpp.has_header('valijson/validator.hpp')
69 valijson = declare_dependency()
70else
71 subproject('valijson', required: false)
72 valijson = declare_dependency(
Patrick Williams37304f02025-02-01 08:38:32 -050073 include_directories: 'subprojects/valijson/include',
Ed Tanous55ae5a82021-08-02 14:00:02 -070074 )
75 valijson = valijson.as_system('system')
Brad Bishopff1ddb72020-01-15 12:24:56 -050076endif
Brad Bishopb4459912019-11-05 19:39:11 -050077
78install_data('blacklist.json')
79
Alexander Hansenedc46342025-01-06 17:01:54 +010080# this creates the 'configs' variable
81subdir('configurations')
82
Ed Tanous9dc2cc52021-12-20 16:05:49 -080083filepaths = []
Alexander Hansend8e86032025-04-25 14:49:15 +020084package_configdir = join_paths(packagedir, 'configurations')
85fs = import('fs')
86
Brad Bishopb4459912019-11-05 19:39:11 -050087foreach c : configs
Ed Tanous9dc2cc52021-12-20 16:05:49 -080088 file = join_paths('configurations', c)
Alexander Hansend8e86032025-04-25 14:49:15 +020089 install_data(
90 file,
91 install_dir: join_paths(
92 package_configdir,
93 fs.parent(fs.relative_to(file, 'configurations')),
94 ),
95 )
Ed Tanous9dc2cc52021-12-20 16:05:49 -080096 filepaths += [file]
Brad Bishopb4459912019-11-05 19:39:11 -050097endforeach
98
Matt Spinler7742c872024-05-02 14:13:21 -050099if get_option('validate-json')
100 validate_script = files('scripts/validate_configs.py')
101 autojson = custom_target(
Patrick Williams37304f02025-02-01 08:38:32 -0500102 'check_syntax',
103 command: [validate_script, '-v', '-k'],
104 depend_files: files(filepaths),
105 build_by_default: true,
Patrick Williams37304f02025-02-01 08:38:32 -0500106 output: 'validate_configs.log',
Matt Spinler7742c872024-05-02 14:13:21 -0500107 )
108endif
Ed Tanous9dc2cc52021-12-20 16:05:49 -0800109
Alexander Hansen6eead742025-04-25 18:15:52 +0200110# this creates the 'schemas' variable
111subdir('schemas')
Brad Bishopb4459912019-11-05 19:39:11 -0500112
113foreach s : schemas
114 install_data(
115 join_paths('schemas', s),
Alexander Hansenddc8eb62025-04-25 18:08:51 +0200116 install_dir: join_paths(packagedir, 'schemas'),
Brad Bishopb4459912019-11-05 19:39:11 -0500117 )
118endforeach
119
120subdir('service_files')
121subdir('src')
Brad Bishopb9f50cd2020-10-14 09:54:58 -0400122
Ed Tanous955c6eb2025-04-08 12:41:55 -0700123if get_option('tests').allowed()
Alexander Hansenf440def2025-06-17 16:29:59 +0200124 subdir('test')
Jason M. Billsff58eba2020-04-14 16:05:30 -0700125endif