blob: fbd3ec03989abdec892325bac96ed7b5a427c77c [file] [log] [blame]
Jagpal Singh Gill4d28bcd2023-04-23 23:34:05 -07001project('phosphor-settingsd', 'cpp',
2 version: '1.0',
3 meson_version: '>=0.58.0',
4 default_options: [
5 'warning_level=3',
6 'werror=true',
7 'cpp_std=c++20',
8 ]
9)
10cpp = meson.get_compiler('cpp')
11
12python_prog = find_program('python3', native: true)
13
14# Define dependencies
15sdbusplus_dep = dependency('sdbusplus')
16phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
17phosphor_logging_dep = dependency('phosphor-logging')
18cereal_dep = dependency('cereal', required: false)
19has_cereal = cpp.has_header_symbol(
20 'cereal/cereal.hpp',
21 'cereal::specialize',
22 dependencies: cereal_dep,
23 required: false)
24if not has_cereal
25 cereal_opts = import('cmake').subproject_options()
26 cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF'})
27 cereal_proj = import('cmake').subproject(
28 'cereal',
29 options: cereal_opts,
30 required: false)
31 assert(cereal_proj.found(), 'cereal is required')
32 cereal_dep = cereal_proj.dependency('cereal')
33endif
34
35# Generate settings_manager.hpp
36settings_gen = custom_target(
37 'settings_manager.hpp'.underscorify(),
38 input: [
39 'settings.py',
40 'settings_manager.mako.hpp',
41 get_option('settings_yaml'),
42 ],
43 output: 'settings_manager.hpp',
44 command: [ python_prog, '@INPUT0@', '-i', '@INPUT2@' ],
45)
46
47# Generate daemon
48settings_manager_sources = [
49 settings_gen,
50]
51
52settings_manager_deps = [
53 cereal_dep,
54 sdbusplus_dep,
55 phosphor_dbus_interfaces_dep,
56 phosphor_logging_dep,
57]
58
59executable(
60 'phosphor-settings-manager',
61 'settings_main.cpp',
62 settings_manager_sources,
63 dependencies: [
64 settings_manager_deps,
65 ],
66 install: true,
67)