blob: e7a117a5b3a2aaa545cc5e7a87b3eaf02bcdf242 [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 Williamsa183f4a2023-08-23 06:31:19 -05007 meson_version: '>=1.1.1',
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)
24 boost = declare_dependency(include_directories: 'subprojects/boost_1_71_0')
25 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')
Alexander Hansenc3db2c32024-08-20 15:01:38 +020039sdbusplus = dependency('sdbusplus', include_type: 'system')
40phosphor_logging_dep = dependency('phosphor-logging')
Andrew Jeffery14a7bc92021-08-02 10:01:22 +093041
Alexander Hansen8c4b1d92024-11-04 14:06:24 +010042if get_option('gpio-presence') or get_option('tests').allowed()
43 libgpio_dep = dependency('libgpiodcxx', default_options: ['bindings=cxx'])
44endif
45
Brad Bishopb4459912019-11-05 19:39:11 -050046systemd = dependency('systemd')
Patrick Williamsee1db762023-04-12 08:05:58 -050047systemd_system_unit_dir = systemd.get_variable(
Brad Bishopb4459912019-11-05 19:39:11 -050048 'systemdsystemunitdir',
Patrick Williams37304f02025-02-01 08:38:32 -050049 pkgconfig_define: ['prefix', get_option('prefix')],
50)
Brad Bishopb4459912019-11-05 19:39:11 -050051packagedir = join_paths(
52 get_option('prefix'),
53 get_option('datadir'),
54 meson.project_name(),
55)
Andrew Jefferya9c58922021-06-01 09:28:59 +093056sysconfdir = join_paths(
57 get_option('prefix'),
58 get_option('sysconfdir'),
59 meson.project_name(),
60)
Brad Bishopb4459912019-11-05 19:39:11 -050061threads = dependency('threads')
Ed Tanous55ae5a82021-08-02 14:00:02 -070062if cpp.has_header('valijson/validator.hpp')
63 valijson = declare_dependency()
64else
65 subproject('valijson', required: false)
66 valijson = declare_dependency(
Patrick Williams37304f02025-02-01 08:38:32 -050067 include_directories: 'subprojects/valijson/include',
Ed Tanous55ae5a82021-08-02 14:00:02 -070068 )
69 valijson = valijson.as_system('system')
Brad Bishopff1ddb72020-01-15 12:24:56 -050070endif
Brad Bishopb4459912019-11-05 19:39:11 -050071
72install_data('blacklist.json')
73
Alexander Hansenedc46342025-01-06 17:01:54 +010074# this creates the 'configs' variable
75subdir('configurations')
76
Ed Tanous9dc2cc52021-12-20 16:05:49 -080077filepaths = []
Alexander Hansend8e86032025-04-25 14:49:15 +020078package_configdir = join_paths(packagedir, 'configurations')
79fs = import('fs')
80
Brad Bishopb4459912019-11-05 19:39:11 -050081foreach c : configs
Ed Tanous9dc2cc52021-12-20 16:05:49 -080082 file = join_paths('configurations', c)
Alexander Hansend8e86032025-04-25 14:49:15 +020083 install_data(
84 file,
85 install_dir: join_paths(
86 package_configdir,
87 fs.parent(fs.relative_to(file, 'configurations')),
88 ),
89 )
Ed Tanous9dc2cc52021-12-20 16:05:49 -080090 filepaths += [file]
Brad Bishopb4459912019-11-05 19:39:11 -050091endforeach
92
Matt Spinler7742c872024-05-02 14:13:21 -050093if get_option('validate-json')
94 validate_script = files('scripts/validate_configs.py')
95 autojson = custom_target(
Patrick Williams37304f02025-02-01 08:38:32 -050096 'check_syntax',
97 command: [validate_script, '-v', '-k'],
98 depend_files: files(filepaths),
99 build_by_default: true,
Patrick Williams37304f02025-02-01 08:38:32 -0500100 output: 'validate_configs.log',
Matt Spinler7742c872024-05-02 14:13:21 -0500101 )
102endif
Ed Tanous9dc2cc52021-12-20 16:05:49 -0800103
Alexander Hansen6eead742025-04-25 18:15:52 +0200104# this creates the 'schemas' variable
105subdir('schemas')
Brad Bishopb4459912019-11-05 19:39:11 -0500106
107foreach s : schemas
108 install_data(
109 join_paths('schemas', s),
Patrick Williams37304f02025-02-01 08:38:32 -0500110 install_dir: join_paths(packagedir, 'configurations', 'schemas'),
Brad Bishopb4459912019-11-05 19:39:11 -0500111 )
112endforeach
113
114subdir('service_files')
115subdir('src')
Brad Bishopb9f50cd2020-10-14 09:54:58 -0400116
Ed Tanous955c6eb2025-04-08 12:41:55 -0700117if get_option('tests').allowed()
Alexander Hansenf440def2025-06-17 16:29:59 +0200118 subdir('test')
Jason M. Billsff58eba2020-04-14 16:05:30 -0700119endif