Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 1 | project( |
| 2 | 'biosconfig-manager', |
| 3 | 'cpp', |
Patrick Williams | 9ace6ac | 2023-07-12 11:16:00 -0500 | [diff] [blame] | 4 | meson_version: '>=1.1.1', |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 5 | default_options: [ |
| 6 | 'warning_level=3', |
| 7 | 'werror=true', |
Patrick Williams | 9ace6ac | 2023-07-12 11:16:00 -0500 | [diff] [blame] | 8 | 'cpp_std=c++23', |
George Liu | fb92842 | 2021-12-08 10:21:44 +0800 | [diff] [blame] | 9 | 'buildtype=debugoptimized' |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 10 | ], |
| 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. |
| 19 | add_project_arguments('-Wno-psabi', language: 'cpp') |
| 20 | |
Tom Joseph | f1101df | 2020-11-06 08:23:34 +0530 | [diff] [blame] | 21 | conf_data = configuration_data() |
| 22 | conf_data.set_quoted('BIOS_PERSIST_PATH', get_option('bios-persist-path')) |
| 23 | configure_file(output: 'config.h', configuration: conf_data) |
| 24 | |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 25 | boost_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 | |
| 32 | deps = [dependency('boost'), |
| 33 | dependency('phosphor-dbus-interfaces'), |
| 34 | dependency('phosphor-logging'), |
| 35 | dependency('sdbusplus'), |
Patrick Williams | d37ce23 | 2024-09-03 16:02:12 -0400 | [diff] [blame] | 36 | dependency('libsystemd'), |
Kuiying Wang | 8f70621 | 2020-12-16 18:59:24 +0800 | [diff] [blame] | 37 | dependency('openssl'), |
Manojkiran Eda | e7f0b66 | 2023-12-16 23:15:18 +0530 | [diff] [blame] | 38 | dependency('nlohmann_json',include_type: 'system'), |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 39 | ] |
| 40 | |
Manojkiran Eda | 72bed80 | 2024-01-24 06:18:48 -0600 | [diff] [blame] | 41 | cereal = dependency('cereal', required: false) |
| 42 | cpp = meson.get_compiler('cpp') |
| 43 | has_cereal = cpp.has_header_symbol( |
| 44 | 'cereal/cereal.hpp', |
| 45 | 'cereal::specialize', |
| 46 | dependencies: cereal, |
| 47 | required: false) |
| 48 | if not has_cereal |
| 49 | cereal_opts = import('cmake').subproject_options() |
| 50 | cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF'}) |
| 51 | cereal_proj = import('cmake').subproject( |
| 52 | 'cereal', |
| 53 | options: cereal_opts, |
| 54 | required: false) |
| 55 | assert(cereal_proj.found(), 'cereal is required') |
| 56 | cereal = cereal_proj.dependency('cereal') |
| 57 | endif |
| 58 | deps += cereal |
| 59 | |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 60 | src_files = ['src/main.cpp', |
| 61 | 'src/manager.cpp', |
| 62 | 'src/manager_serialize.cpp', |
| 63 | 'src/password.cpp' |
| 64 | ] |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 65 | |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 66 | executable('biosconfig-manager', |
| 67 | src_files, |
| 68 | implicit_include_directories: true, |
| 69 | include_directories: ['include'], |
| 70 | dependencies: deps, |
| 71 | cpp_args : boost_args, |
| 72 | install: true, |
| 73 | install_dir: get_option('bindir')) |
Kuiying Wang | 8f70621 | 2020-12-16 18:59:24 +0800 | [diff] [blame] | 74 | |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 75 | systemd = dependency('systemd') |
George Liu | 6a7ee5c | 2021-12-29 13:53:52 +0800 | [diff] [blame] | 76 | systemd_system_unit_dir = systemd.get_variable( |
Patrick Williams | c76391b | 2023-04-12 08:01:25 -0500 | [diff] [blame] | 77 | 'systemdsystemunitdir', |
George Liu | 6a7ee5c | 2021-12-29 13:53:52 +0800 | [diff] [blame] | 78 | pkgconfig_define: ['prefix', get_option('prefix')]) |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 79 | |
George Liu | 628e4aa | 2023-08-16 13:58:42 +0800 | [diff] [blame] | 80 | fs = import('fs') |
| 81 | fs.copyfile( |
| 82 | 'service_files/xyz.openbmc_project.biosconfig_manager.service', |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 83 | install: true, |
George Liu | 628e4aa | 2023-08-16 13:58:42 +0800 | [diff] [blame] | 84 | install_dir: systemd_system_unit_dir |
Kuiying Wang | 642f437 | 2020-08-12 15:35:46 +0800 | [diff] [blame] | 85 | ) |