blob: 2733a1e65f42de2ede34a87bd98ec16656bf4b46 [file] [log] [blame]
Kuiying Wang642f4372020-08-12 15:35:46 +08001project(
2 'biosconfig-manager',
3 'cpp',
Patrick Williams9ace6ac2023-07-12 11:16:00 -05004 meson_version: '>=1.1.1',
Kuiying Wang642f4372020-08-12 15:35:46 +08005 default_options: [
6 'warning_level=3',
7 'werror=true',
Patrick Williams9ace6ac2023-07-12 11:16:00 -05008 'cpp_std=c++23',
George Liufb928422021-12-08 10:21:44 +08009 'buildtype=debugoptimized'
Kuiying Wang642f4372020-08-12 15:35:46 +080010 ],
11 license: 'Apache-2.0',
12 version: '1.0',
13)
14
15# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL
16# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project
17# Basically, gcc 6 and gcc 7 are not ABI compatible, but since the whole OpenBMC
18# project uses the same compiler, we can safely ignmore these info notes.
19add_project_arguments('-Wno-psabi', language: 'cpp')
20
Tom Josephf1101df2020-11-06 08:23:34 +053021conf_data = configuration_data()
22conf_data.set_quoted('BIOS_PERSIST_PATH', get_option('bios-persist-path'))
23configure_file(output: 'config.h', configuration: conf_data)
24
Kuiying Wang642f4372020-08-12 15:35:46 +080025boost_args = ['-DBOOST_ALL_NO_LIB',
26 '-DBOOST_ASIO_DISABLE_THREADS',
27 '-DBOOST_ERROR_CODE_HEADER_ONLY',
28 '-DBOOST_NO_RTTI',
29 '-DBOOST_NO_TYPEID',
30 '-DBOOST_SYSTEM_NO_DEPRECATED']
31
32deps = [dependency('boost'),
33 dependency('phosphor-dbus-interfaces'),
34 dependency('phosphor-logging'),
35 dependency('sdbusplus'),
36 dependency('systemd'),
Kuiying Wang8f706212020-12-16 18:59:24 +080037 dependency('openssl'),
Manojkiran Edae7f0b662023-12-16 23:15:18 +053038 dependency('nlohmann_json',include_type: 'system'),
39 dependency('cereal')
Kuiying Wang642f4372020-08-12 15:35:46 +080040]
41
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000042src_files = ['src/main.cpp',
43 'src/manager.cpp',
44 'src/manager_serialize.cpp',
45 'src/password.cpp'
46]
Kuiying Wang642f4372020-08-12 15:35:46 +080047
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000048executable('biosconfig-manager',
49 src_files,
50 implicit_include_directories: true,
51 include_directories: ['include'],
52 dependencies: deps,
53 cpp_args : boost_args,
54 install: true,
55 install_dir: get_option('bindir'))
Kuiying Wang8f706212020-12-16 18:59:24 +080056
Kuiying Wang642f4372020-08-12 15:35:46 +080057systemd = dependency('systemd')
George Liu6a7ee5c2021-12-29 13:53:52 +080058systemd_system_unit_dir = systemd.get_variable(
Patrick Williamsc76391b2023-04-12 08:01:25 -050059 'systemdsystemunitdir',
George Liu6a7ee5c2021-12-29 13:53:52 +080060 pkgconfig_define: ['prefix', get_option('prefix')])
Kuiying Wang642f4372020-08-12 15:35:46 +080061
George Liu628e4aa2023-08-16 13:58:42 +080062fs = import('fs')
63fs.copyfile(
64 'service_files/xyz.openbmc_project.biosconfig_manager.service',
Kuiying Wang642f4372020-08-12 15:35:46 +080065 install: true,
George Liu628e4aa2023-08-16 13:58:42 +080066 install_dir: systemd_system_unit_dir
Kuiying Wang642f4372020-08-12 15:35:46 +080067)