blob: 5a078f895a2b1dd78b91dbc5a0dd69f02a523302 [file] [log] [blame]
Manojkiran Eda84855ab2021-12-05 11:09:02 +05301project(
2 'post-code-manager',
3 'cpp',
4 default_options: [
5 'cpp_std=c++20',
6 'warning_level=3',
7 'werror=true',
8 ],
9 license: 'Apache-2.0',
Patrick Williams65a66542023-04-12 08:01:04 -050010 meson_version: '>=0.58.0',
Manojkiran Eda84855ab2021-12-05 11:09:02 +053011 version: '1.0',
12)
13
14
15conf_data = configuration_data()
Kumar Thangavel4e081562022-12-01 12:56:07 +053016conf_data.set_quoted('DBUS_OBJECT_NAME', '/xyz/openbmc_project/State/Boot/PostCode')
Manojkiran Eda84855ab2021-12-05 11:09:02 +053017conf_data.set_quoted('DBUS_INTF_NAME','xyz.openbmc_project.State.Boot.PostCode')
18conf_data.set('MAX_BOOT_CYCLE_COUNT',get_option('max-boot-cycle-count'))
Bonnie Loc1819372022-10-27 17:14:55 +080019conf_data.set('MAX_POST_CODE_SIZE_PER_CYCLE',get_option('max-post-code-size-per-cycle'))
Manojkiran Eda84855ab2021-12-05 11:09:02 +053020
21if get_option('bios-post-code-log').enabled()
22 add_project_arguments('-DENABLE_BIOS_POST_CODE_LOG',language: 'cpp')
23endif
24
25configure_file(output: 'config.h',
26 configuration: conf_data
27)
28
Patrick Williamse7098742022-03-21 10:01:23 -050029sdbusplus = dependency('sdbusplus')
30phosphor_logging = dependency('phosphor-logging')
31phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
Manojkiran Eda84855ab2021-12-05 11:09:02 +053032
33cxx = meson.get_compiler('cpp')
34cereal_dep = dependency('cereal', required: false)
35has_cereal = cxx.has_header_symbol(
36 'cereal/cereal.hpp',
37 'cereal::specialize',
38 dependencies: cereal_dep,
39 required: false)
40if not has_cereal
41 cereal_opts = import('cmake').subproject_options()
42 cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF'})
43 cereal_proj = import('cmake').subproject(
44 'cereal',
45 options: cereal_opts,
46 required: false)
47 assert(cereal_proj.found(), 'cereal is required')
48 cereal_dep = cereal_proj.dependency('cereal')
49endif
50
51systemd_system_unit_dir = dependency('systemd').get_variable(
Patrick Williams65a66542023-04-12 08:01:04 -050052 'systemdsystemunitdir')
Manojkiran Eda84855ab2021-12-05 11:09:02 +053053
54install_subdir('service_files',
55 install_dir : systemd_system_unit_dir,
56 strip_directory : true)
57
58executable(
59 'post-code-manager',
60 'src/main.cpp',
61 'src/post_code.cpp',
62 install: true,
63 dependencies: [
64 sdbusplus,
65 phosphor_dbus_interfaces,
66 phosphor_logging,
67 cereal_dep],
68 include_directories: 'inc')