blob: 2864764dde1b545ce6123269c988c56ff5e75191 [file] [log] [blame]
Patrick Williamsec807fc2025-02-03 14:13:00 -05001project(
2 'phosphor-bmc-code-mgmt',
3 'cpp',
Adriana Kobylak0af80a42020-05-05 13:32:10 -05004 default_options: [
Gunnar Millsf7a69e12020-06-15 12:16:51 -05005 'buildtype=debugoptimized',
Patrick Williamsb9ecb2b2023-07-12 11:15:11 -05006 'cpp_std=c++23',
Adriana Kobylak0af80a42020-05-05 13:32:10 -05007 'warning_level=3',
Patrick Williamsec807fc2025-02-03 14:13:00 -05008 'werror=true',
Adriana Kobylak0af80a42020-05-05 13:32:10 -05009 ],
Patrick Williamsb9ecb2b2023-07-12 11:15:11 -050010 meson_version: '>=1.1.1',
Adriana Kobylak0af80a42020-05-05 13:32:10 -050011 license: 'Apache-2.0',
Patrick Williamsec807fc2025-02-03 14:13:00 -050012 version: '1.0',
13)
Adriana Kobylak0af80a42020-05-05 13:32:10 -050014
Lei YU25868182021-05-14 14:50:51 +080015add_project_arguments(
16 '-DBOOST_SYSTEM_NO_DEPRECATED',
17 '-DBOOST_ERROR_CODE_HEADER_ONLY',
18 '-DBOOST_NO_RTTI',
19 '-DBOOST_NO_TYPEID',
20 '-DBOOST_ALL_NO_LIB',
21 '-DBOOST_ASIO_DISABLE_THREADS',
22 '-DBOOST_ASIO_NO_DEPRECATED',
23 language: 'cpp',
24)
25
Patrick Williams40267022021-08-26 16:48:42 -050026cpp = meson.get_compiler('cpp')
27
Konstantin Aladyshevfa34e222024-04-02 17:12:40 +030028boost_dep = dependency('boost')
29
Patrick Williamsc026f6c2022-03-21 09:37:14 -050030sdbusplus_dep = dependency('sdbusplus')
31sdbusplusplus_prog = find_program('sdbus++', native: true)
32sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true)
Patrick Williams40267022021-08-26 16:48:42 -050033
Patrick Williamsc026f6c2022-03-21 09:37:14 -050034pdi_dep = dependency('phosphor-dbus-interfaces')
35phosphor_logging_dep = dependency('phosphor-logging')
Patrick Williams40267022021-08-26 16:48:42 -050036
37cereal_dep = dependency('cereal', required: false)
38has_cereal = cpp.has_header_symbol(
39 'cereal/cereal.hpp',
40 'cereal::specialize',
41 dependencies: cereal_dep,
Patrick Williamsec807fc2025-02-03 14:13:00 -050042 required: false,
43)
Patrick Williams40267022021-08-26 16:48:42 -050044if not has_cereal
45 cereal_opts = import('cmake').subproject_options()
Patrick Williamsec807fc2025-02-03 14:13:00 -050046 cereal_opts.add_cmake_defines(
47 {'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'},
48 )
Patrick Williams40267022021-08-26 16:48:42 -050049 cereal_proj = import('cmake').subproject(
50 'cereal',
51 options: cereal_opts,
Patrick Williamsec807fc2025-02-03 14:13:00 -050052 required: false,
53 )
Patrick Williams40267022021-08-26 16:48:42 -050054 assert(cereal_proj.found(), 'cereal is required')
55 cereal_dep = cereal_proj.dependency('cereal')
56endif
57
Patrick Williamsec807fc2025-02-03 14:13:00 -050058deps = [cereal_dep, pdi_dep, phosphor_logging_dep, sdbusplus_dep]
Adriana Kobylake0aa7802020-05-05 13:54:49 -050059
60ssl = dependency('openssl')
61
Adriana Kobylak29a0d902020-05-05 13:59:49 -050062systemd = dependency('systemd')
Patrick Williamse80b5bc2023-04-12 08:01:05 -050063systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
Adriana Kobylak29a0d902020-05-05 13:59:49 -050064
Alexander Hansen4a053c82024-11-26 17:02:39 +010065build_tests = get_option('tests')
66
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -080067subdir('bmc')
Alexander Hansen4a053c82024-11-26 17:02:39 +010068
Alexander Hansen4a053c82024-11-26 17:02:39 +010069common_include = include_directories('.')
70
Alexander Hansencc372352025-01-14 14:15:39 +010071common_build = build_tests.allowed()
72
73if common_build
74 libpldm_dep = dependency('libpldm')
75
76 subdir('common')
77endif
78
Alexander Hansen88b98bf2025-01-29 17:18:51 +010079if build_tests.allowed()
Alexander Hansencc372352025-01-14 14:15:39 +010080 subdir('test')
Alexander Hansen4a053c82024-11-26 17:02:39 +010081endif
Alexander Hansen00b3cae2024-11-26 17:32:33 +010082