blob: 74245c0f54d83f8679c54bd9b8c623bce04411ba [file] [log] [blame]
Adriana Kobylak0af80a42020-05-05 13:32:10 -05001project('phosphor-bmc-code-mgmt', 'cpp',
2 default_options: [
Gunnar Millsf7a69e12020-06-15 12:16:51 -05003 'buildtype=debugoptimized',
Patrick Williamsb9ecb2b2023-07-12 11:15:11 -05004 'cpp_std=c++23',
Adriana Kobylak0af80a42020-05-05 13:32:10 -05005 'warning_level=3',
Gunnar Millsf7a69e12020-06-15 12:16:51 -05006 'werror=true'
Adriana Kobylak0af80a42020-05-05 13:32:10 -05007 ],
Patrick Williamsb9ecb2b2023-07-12 11:15:11 -05008 meson_version: '>=1.1.1',
Adriana Kobylak0af80a42020-05-05 13:32:10 -05009 license: 'Apache-2.0',
10 version: '1.0')
11
Lei YU25868182021-05-14 14:50:51 +080012add_project_arguments(
13 '-DBOOST_SYSTEM_NO_DEPRECATED',
14 '-DBOOST_ERROR_CODE_HEADER_ONLY',
15 '-DBOOST_NO_RTTI',
16 '-DBOOST_NO_TYPEID',
17 '-DBOOST_ALL_NO_LIB',
18 '-DBOOST_ASIO_DISABLE_THREADS',
19 '-DBOOST_ASIO_NO_DEPRECATED',
20 language: 'cpp',
21)
22
Patrick Williams40267022021-08-26 16:48:42 -050023cpp = meson.get_compiler('cpp')
24
Konstantin Aladyshevfa34e222024-04-02 17:12:40 +030025boost_dep = dependency('boost')
26
Patrick Williamsc026f6c2022-03-21 09:37:14 -050027sdbusplus_dep = dependency('sdbusplus')
28sdbusplusplus_prog = find_program('sdbus++', native: true)
29sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true)
Patrick Williams40267022021-08-26 16:48:42 -050030
Patrick Williamsc026f6c2022-03-21 09:37:14 -050031pdi_dep = dependency('phosphor-dbus-interfaces')
32phosphor_logging_dep = dependency('phosphor-logging')
Patrick Williams40267022021-08-26 16:48:42 -050033
34cereal_dep = dependency('cereal', required: false)
35has_cereal = cpp.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()
Konstantin Aladyshevd2d57bb2024-04-02 17:05:10 +030042 cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'})
Patrick Williams40267022021-08-26 16:48:42 -050043 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
Adriana Kobylake0aa7802020-05-05 13:54:49 -050051deps = [
Patrick Williams40267022021-08-26 16:48:42 -050052 cereal_dep,
Patrick Williamsc026f6c2022-03-21 09:37:14 -050053 pdi_dep,
54 phosphor_logging_dep,
55 sdbusplus_dep,
Adriana Kobylake0aa7802020-05-05 13:54:49 -050056]
57
58ssl = dependency('openssl')
59
Adriana Kobylak29a0d902020-05-05 13:59:49 -050060systemd = dependency('systemd')
Patrick Williamse80b5bc2023-04-12 08:01:05 -050061systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
Adriana Kobylak29a0d902020-05-05 13:59:49 -050062
Alexander Hansen4a053c82024-11-26 17:02:39 +010063build_tests = get_option('tests')
64
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -080065subdir('bmc')
Alexander Hansen4a053c82024-11-26 17:02:39 +010066
Alexander Hansen88b98bf2025-01-29 17:18:51 +010067if build_tests.allowed()
68 libpldm_dep = dependency('libpldm')
69endif
Alexander Hansen4a053c82024-11-26 17:02:39 +010070
71common_include = include_directories('.')
72
Alexander Hansen88b98bf2025-01-29 17:18:51 +010073if build_tests.allowed()
Alexander Hansen00b3cae2024-11-26 17:32:33 +010074 subdir('common')
Alexander Hansen4a053c82024-11-26 17:02:39 +010075 subdir('test')
76endif
Alexander Hansen00b3cae2024-11-26 17:32:33 +010077