blob: 43781c7496aa98799d1b46e583288b9a04d8ddaf [file] [log] [blame]
Tom Joseph82e95572020-05-07 20:28:05 +05301project(
2 'phosphor-srvcfg-manager',
3 'cpp',
Patrick Williamscb282492025-02-01 08:38:01 -05004 default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
Tom Joseph82e95572020-05-07 20:28:05 +05305 license: 'Apache-2.0',
6 version: '1.0',
Patrick Williams70c78fe2023-07-12 11:15:58 -05007 meson_version: '>=1.1.1',
Tom Joseph82e95572020-05-07 20:28:05 +05308)
9
10# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL
11# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project
12# Basically, gcc 6 and gcc 7 are not ABI compatible, but since the whole OpenBMC
13# project uses the same compiler, we can safely ignmore these info notes.
14add_project_arguments('-Wno-psabi', language: 'cpp')
15
Patrick Williamscb282492025-02-01 08:38:01 -050016boost_args = [
17 '-DBOOST_ALL_NO_LIB',
18 '-DBOOST_ASIO_DISABLE_THREADS',
19 '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
20 '-DBOOST_ERROR_CODE_HEADER_ONLY',
21 '-DBOOST_NO_RTTI',
22 '-DBOOST_NO_TYPEID',
23 '-DBOOST_SYSTEM_NO_DEPRECATED',
Tom Joseph82e95572020-05-07 20:28:05 +053024]
25
Patrick Williamscb282492025-02-01 08:38:01 -050026deps = [
Ed Tanousc828db72025-04-01 16:42:24 -070027 dependency('boost', modules: ['coroutine', 'context']),
Patrick Williamscb282492025-02-01 08:38:01 -050028 dependency('phosphor-dbus-interfaces'),
29 dependency('phosphor-logging'),
30 dependency('sdbusplus'),
31 dependency('libsystemd'),
32]
33
34if (get_option('usb-code-update').allowed())
35 add_project_arguments('-DUSB_CODE_UPDATE', language: 'cpp')
Chicago Duan25a0f632021-11-11 16:32:07 +080036endif
37
Andrew Geisslercb0f1342025-04-22 16:08:27 -050038if (get_option('persist-settings-to-file').allowed())
39 add_project_arguments('-DPERSIST_SETTINGS', language: 'cpp')
40 deps += [dependency('nlohmann_json', include_type: 'system')]
41endif
42
Patrick Williamscb282492025-02-01 08:38:01 -050043executable(
44 'phosphor-srvcfg-manager',
45 'src/main.cpp',
46 'src/srvcfg_manager.cpp',
47 'src/utils.cpp',
48 implicit_include_directories: false,
49 include_directories: ['inc'],
50 dependencies: deps,
51 cpp_args: boost_args,
52 install: true,
53 install_dir: get_option('bindir'),
54)
Tom Joseph82e95572020-05-07 20:28:05 +053055
56systemd = dependency('systemd')
Patrik Tesarik9cd87072021-06-02 19:42:40 +020057systemd_system_unit_dir = systemd.get_variable(
Patrick Williams0a95d912025-07-09 11:27:42 -040058 'systemd_system_unit_dir',
Patrick Williamscb282492025-02-01 08:38:01 -050059 pkgconfig_define: ['prefix', get_option('prefix')],
60)
Tom Joseph82e95572020-05-07 20:28:05 +053061
George Liuc241bde2023-08-16 16:02:28 +080062fs = import('fs')
63fs.copyfile(
64 'srvcfg-manager.service',
Tom Joseph82e95572020-05-07 20:28:05 +053065 install: true,
Patrick Williamscb282492025-02-01 08:38:01 -050066 install_dir: systemd_system_unit_dir,
Tom Joseph82e95572020-05-07 20:28:05 +053067)