blob: f06e0219d0a2555b5dd54520df79bed58398a606 [file] [log] [blame]
Willy Tue39f9392022-06-15 13:24:20 -07001project(
2 'fb-ipmi-oem',
3 'cpp',
4 version: '0.1',
Patrick Williams7c24dde2023-07-12 11:15:07 -05005 meson_version: '>=1.1.1',
Willy Tue39f9392022-06-15 13:24:20 -07006 default_options: [
7 'werror=true',
8 'warning_level=3',
Patrick Williams7c24dde2023-07-12 11:15:07 -05009 'cpp_std=c++23',
Willy Tue39f9392022-06-15 13:24:20 -070010 ])
11
12# Project Arguments
13cpp = meson.get_compiler('cpp')
14add_project_arguments(
15 cpp.get_supported_arguments([
16 '-DBOOST_ERROR_CODE_HEADER_ONLY',
17 '-DBOOST_SYSTEM_NO_DEPRECATED',
18 '-DBOOST_ALL_NO_LIB',
19 '-DBOOST_NO_RTTI',
20 '-DBOOST_NO_TYPEID',
21 '-DBOOST_ASIO_DISABLE_THREADS',
22 '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
23 '-Wno-psabi',
24 '-Wno-pedantic',
25 ]),
26 language : 'cpp')
27
Patrick Williams708286a2022-07-25 09:49:50 -050028fs = import('fs')
29
Willy Tue39f9392022-06-15 13:24:20 -070030host_instances = '0'
31if get_option('host-instances') != ''
32 host_instances = get_option('host-instances')
33endif
34
Jayashree Dhanapal4ec80562022-06-28 15:41:47 +053035conf_data = configuration_data()
36conf_data.set_quoted('INSTANCES',host_instances)
Bonnie Lo4ae63e72023-02-09 15:27:54 +080037conf_data.set('POST_CODE_BYTES', get_option('post-code-bytes'))
Jayashree Dhanapal4ec80562022-06-28 15:41:47 +053038
39configure_file(input: 'meson_config.h.in',
40 output: 'config.h',
41 configuration: conf_data)
Willy Tue39f9392022-06-15 13:24:20 -070042
43if not get_option('bic').disabled()
44 add_project_arguments(
45 cpp.get_supported_arguments([
46 '-DBIC_ENABLED',
47 ]),
48 language : 'cpp')
49endif
50
51root_inc = include_directories('.', 'include')
52
53# Dependencies
Patrick Williams2e9921c2022-07-25 10:17:05 -050054sdbusplus_dep = dependency('sdbusplus')
55phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
Willy Tue39f9392022-06-15 13:24:20 -070056phosphor_logging_dep = dependency('phosphor-logging')
Willy Tue39f9392022-06-15 13:24:20 -070057ipmid_dep = dependency('libipmid')
Patrick Williams2e9921c2022-07-25 10:17:05 -050058channellayer_dep = dependency('libchannellayer')
59userlayer_dep = dependency('libuserlayer')
60
61if cpp.has_header_symbol(
62 'nlohmann/json.hpp',
63 'nlohmann::json::string_t',
64 required:false)
65 nlohmann_json_dep = declare_dependency()
66else
67 nlohmann_json_dep = dependency('nlohmann-json')
68endif
Willy Tue39f9392022-06-15 13:24:20 -070069
70zfboemcmds_pre = declare_dependency(
71 include_directories: root_inc,
72 dependencies: [
Patrick Williams2e9921c2022-07-25 10:17:05 -050073 channellayer_dep,
74 ipmid_dep,
75 nlohmann_json_dep,
76 phosphor_dbus_interfaces_dep,
Willy Tue39f9392022-06-15 13:24:20 -070077 phosphor_logging_dep,
78 sdbusplus_dep,
Willy Tue39f9392022-06-15 13:24:20 -070079 userlayer_dep,
80 ])
81
Patrick Williams17bd2ea2022-06-24 16:44:51 -050082zfboemcmds_lib = library(
Willy Tue39f9392022-06-15 13:24:20 -070083 'zfboemcmds',
cchouxb2ae88b2023-09-13 00:35:36 +080084 'src/commandutils.cpp',
Willy Tue39f9392022-06-15 13:24:20 -070085 'src/oemcommands.cpp',
86 'src/appcommands.cpp',
87 'src/storagecommands.cpp',
88 'src/usb-dbg.cpp',
89 'src/selcommands.cpp',
90 'src/transportcommands.cpp',
91 'src/biccommands.cpp',
92 implicit_include_directories: false,
93 dependencies: zfboemcmds_pre,
Patrick Williams17bd2ea2022-06-24 16:44:51 -050094 version: meson.project_version(),
95 override_options: ['b_lundef=false'],
Willy Tue39f9392022-06-15 13:24:20 -070096 install: true,
97 install_dir: get_option('libdir') / 'ipmid-providers')
Karthikeyan Pasupathi3048dd52022-06-30 21:51:11 +053098
99if get_option('machine') != ''
100 configfile = [
101 'cri_sensors.json',
102 'gpio_desc.json',
103 'post_desc.json'
104 ]
105 foreach c : configfile
Patrick Williams708286a2022-07-25 09:49:50 -0500106 file = join_paths('configs', get_option('machine'), c)
107 if not fs.is_file(file)
108 warning('Missing config file: ' + file)
109 else
110 install_data(
111 sources : file,
112 install_dir : get_option('datadir') / 'lcd-debug'
113 )
114 endif
Karthikeyan Pasupathi3048dd52022-06-30 21:51:11 +0530115 endforeach
116endif