blob: 6b98f8c85c10ab3ab8be8adfd7f3420d53f1913c [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')
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()
Alexander Hansen7cf00d32025-07-24 15:53:31 +020043 libgpio_dep = dependency(
44 'libgpiodcxx',
45 default_options: ['bindings=cxx'],
46 version: '<1.7.0',
47 )
Alexander Hansen8c4b1d92024-11-04 14:06:24 +010048endif
49
Brad Bishopb4459912019-11-05 19:39:11 -050050systemd = dependency('systemd')
Patrick Williamsee1db762023-04-12 08:05:58 -050051systemd_system_unit_dir = systemd.get_variable(
Brad Bishopb4459912019-11-05 19:39:11 -050052 'systemdsystemunitdir',
Patrick Williams37304f02025-02-01 08:38:32 -050053 pkgconfig_define: ['prefix', get_option('prefix')],
54)
Brad Bishopb4459912019-11-05 19:39:11 -050055packagedir = join_paths(
56 get_option('prefix'),
57 get_option('datadir'),
58 meson.project_name(),
59)
Andrew Jefferya9c58922021-06-01 09:28:59 +093060sysconfdir = join_paths(
61 get_option('prefix'),
62 get_option('sysconfdir'),
63 meson.project_name(),
64)
Brad Bishopb4459912019-11-05 19:39:11 -050065threads = dependency('threads')
Ed Tanous55ae5a82021-08-02 14:00:02 -070066if cpp.has_header('valijson/validator.hpp')
67 valijson = declare_dependency()
68else
69 subproject('valijson', required: false)
70 valijson = declare_dependency(
Patrick Williams37304f02025-02-01 08:38:32 -050071 include_directories: 'subprojects/valijson/include',
Ed Tanous55ae5a82021-08-02 14:00:02 -070072 )
73 valijson = valijson.as_system('system')
Brad Bishopff1ddb72020-01-15 12:24:56 -050074endif
Brad Bishopb4459912019-11-05 19:39:11 -050075
76install_data('blacklist.json')
77
Alexander Hansenedc46342025-01-06 17:01:54 +010078# this creates the 'configs' variable
79subdir('configurations')
80
Ed Tanous9dc2cc52021-12-20 16:05:49 -080081filepaths = []
Alexander Hansend8e86032025-04-25 14:49:15 +020082package_configdir = join_paths(packagedir, 'configurations')
83fs = import('fs')
84
Brad Bishopb4459912019-11-05 19:39:11 -050085foreach c : configs
Ed Tanous9dc2cc52021-12-20 16:05:49 -080086 file = join_paths('configurations', c)
Alexander Hansend8e86032025-04-25 14:49:15 +020087 install_data(
88 file,
89 install_dir: join_paths(
90 package_configdir,
91 fs.parent(fs.relative_to(file, 'configurations')),
92 ),
93 )
Ed Tanous9dc2cc52021-12-20 16:05:49 -080094 filepaths += [file]
Brad Bishopb4459912019-11-05 19:39:11 -050095endforeach
96
Matt Spinler7742c872024-05-02 14:13:21 -050097if get_option('validate-json')
98 validate_script = files('scripts/validate_configs.py')
99 autojson = custom_target(
Patrick Williams37304f02025-02-01 08:38:32 -0500100 'check_syntax',
101 command: [validate_script, '-v', '-k'],
102 depend_files: files(filepaths),
103 build_by_default: true,
Patrick Williams37304f02025-02-01 08:38:32 -0500104 output: 'validate_configs.log',
Matt Spinler7742c872024-05-02 14:13:21 -0500105 )
106endif
Ed Tanous9dc2cc52021-12-20 16:05:49 -0800107
Alexander Hansen6eead742025-04-25 18:15:52 +0200108# this creates the 'schemas' variable
109subdir('schemas')
Brad Bishopb4459912019-11-05 19:39:11 -0500110
111foreach s : schemas
112 install_data(
113 join_paths('schemas', s),
Alexander Hansenddc8eb62025-04-25 18:08:51 +0200114 install_dir: join_paths(packagedir, 'schemas'),
Brad Bishopb4459912019-11-05 19:39:11 -0500115 )
116endforeach
117
118subdir('service_files')
119subdir('src')
Brad Bishopb9f50cd2020-10-14 09:54:58 -0400120
Ed Tanous955c6eb2025-04-08 12:41:55 -0700121if get_option('tests').allowed()
Alexander Hansenf440def2025-06-17 16:29:59 +0200122 subdir('test')
Jason M. Billsff58eba2020-04-14 16:05:30 -0700123endif