xref: /openbmc/bios-settings-mgr/meson.build (revision 1a1dfbd2)
1642f437eSKuiying Wangproject(
2642f437eSKuiying Wang    'biosconfig-manager',
3642f437eSKuiying Wang    'cpp',
4fb928424SGeorge Liu    meson_version: '>=0.58.0',
5642f437eSKuiying Wang    default_options: [
6642f437eSKuiying Wang        'warning_level=3',
7642f437eSKuiying Wang        'werror=true',
8fb928424SGeorge Liu        'cpp_std=c++20',
9fb928424SGeorge Liu        'buildtype=debugoptimized'
10642f437eSKuiying Wang    ],
11642f437eSKuiying Wang    license: 'Apache-2.0',
12642f437eSKuiying Wang    version: '1.0',
13642f437eSKuiying Wang)
14642f437eSKuiying Wang
15642f437eSKuiying Wang# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL
16642f437eSKuiying Wang# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project
17642f437eSKuiying Wang# Basically, gcc 6 and gcc 7 are not ABI compatible, but since the whole OpenBMC
18642f437eSKuiying Wang# project uses the same compiler, we can safely ignmore these info notes.
19642f437eSKuiying Wangadd_project_arguments('-Wno-psabi', language: 'cpp')
20642f437eSKuiying Wang
21f1101df2STom Josephconf_data = configuration_data()
22f1101df2STom Josephconf_data.set_quoted('BIOS_PERSIST_PATH', get_option('bios-persist-path'))
23f1101df2STom Josephconfigure_file(output: 'config.h', configuration: conf_data)
24f1101df2STom Joseph
25642f437eSKuiying Wangboost_args = ['-DBOOST_ALL_NO_LIB',
26642f437eSKuiying Wang              '-DBOOST_ASIO_DISABLE_THREADS',
27642f437eSKuiying Wang              '-DBOOST_ERROR_CODE_HEADER_ONLY',
28642f437eSKuiying Wang              '-DBOOST_NO_RTTI',
29642f437eSKuiying Wang              '-DBOOST_NO_TYPEID',
30642f437eSKuiying Wang              '-DBOOST_SYSTEM_NO_DEPRECATED']
31642f437eSKuiying Wang
32642f437eSKuiying Wangdeps = [dependency('boost'),
33642f437eSKuiying Wang        dependency('phosphor-dbus-interfaces'),
34642f437eSKuiying Wang        dependency('phosphor-logging'),
35642f437eSKuiying Wang        dependency('sdbusplus'),
36642f437eSKuiying Wang        dependency('systemd'),
378f706213SKuiying Wang        dependency('openssl'),
38642f437eSKuiying Wang]
39642f437eSKuiying Wang
40*1a1dfbd2SArun Lal K Msrc_files = ['src/main.cpp',
41642f437eSKuiying Wang             'src/manager.cpp',
42f1101df2STom Joseph             'src/manager_serialize.cpp',
43*1a1dfbd2SArun Lal K M             'src/password.cpp'
44*1a1dfbd2SArun Lal K M]
45642f437eSKuiying Wang
46*1a1dfbd2SArun Lal K Mexecutable('biosconfig-manager',
47*1a1dfbd2SArun Lal K M           src_files,
488f706213SKuiying Wang           implicit_include_directories: true,
498f706213SKuiying Wang           include_directories: ['include'],
508f706213SKuiying Wang           dependencies: deps,
518f706213SKuiying Wang           cpp_args : boost_args,
528f706213SKuiying Wang           install: true,
538f706213SKuiying Wang           install_dir: get_option('bindir'))
548f706213SKuiying Wang
55642f437eSKuiying Wangsystemd = dependency('systemd')
566a7ee5c2SGeorge Liusystemd_system_unit_dir = systemd.get_variable(
576a7ee5c2SGeorge Liu    pkgconfig: 'systemdsystemunitdir',
586a7ee5c2SGeorge Liu    pkgconfig_define: ['prefix', get_option('prefix')])
59642f437eSKuiying Wang
60642f437eSKuiying Wangconfigure_file(
61642f437eSKuiying Wang    copy: true,
62642f437eSKuiying Wang    input: 'service_files/xyz.openbmc_project.biosconfig_manager.service',
63642f437eSKuiying Wang    install: true,
64642f437eSKuiying Wang    install_dir: systemd_system_unit_dir,
65642f437eSKuiying Wang    output: 'xyz.openbmc_project.biosconfig_manager.service'
66642f437eSKuiying Wang)
67