blob: 9b00bf4c22d67d5b8900fcf9da1c7da9e1222877 [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 = []
Brad Bishopb4459912019-11-05 19:39:11 -050078foreach c : configs
Ed Tanous9dc2cc52021-12-20 16:05:49 -080079 file = join_paths('configurations', c)
Patrick Williams37304f02025-02-01 08:38:32 -050080 install_data(file, install_dir: join_paths(packagedir, 'configurations'))
Ed Tanous9dc2cc52021-12-20 16:05:49 -080081 filepaths += [file]
Brad Bishopb4459912019-11-05 19:39:11 -050082endforeach
83
Matt Spinler7742c872024-05-02 14:13:21 -050084if get_option('validate-json')
85 validate_script = files('scripts/validate_configs.py')
86 autojson = custom_target(
Patrick Williams37304f02025-02-01 08:38:32 -050087 'check_syntax',
88 command: [validate_script, '-v', '-k'],
89 depend_files: files(filepaths),
90 build_by_default: true,
Patrick Williams37304f02025-02-01 08:38:32 -050091 output: 'validate_configs.log',
Matt Spinler7742c872024-05-02 14:13:21 -050092 )
93endif
Ed Tanous9dc2cc52021-12-20 16:05:49 -080094
Alexander Hansen6eead742025-04-25 18:15:52 +020095# this creates the 'schemas' variable
96subdir('schemas')
Brad Bishopb4459912019-11-05 19:39:11 -050097
98foreach s : schemas
99 install_data(
100 join_paths('schemas', s),
Patrick Williams37304f02025-02-01 08:38:32 -0500101 install_dir: join_paths(packagedir, 'configurations', 'schemas'),
Brad Bishopb4459912019-11-05 19:39:11 -0500102 )
103endforeach
104
105subdir('service_files')
106subdir('src')
Brad Bishopb9f50cd2020-10-14 09:54:58 -0400107
Ed Tanous955c6eb2025-04-08 12:41:55 -0700108if get_option('tests').allowed()
Alexander Hansenf440def2025-06-17 16:29:59 +0200109 subdir('test')
Jason M. Billsff58eba2020-04-14 16:05:30 -0700110endif