blob: cdde01f1784a61d210fc3c5c31f4b104f119ad94 [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'))
Peter Yinb340aa22024-07-08 16:07:55 +080038conf_data.set('DEBUG_CARD_FRAME_SIZE', get_option('debug-card-frame-size'))
Jayashree Dhanapal4ec80562022-06-28 15:41:47 +053039
40configure_file(input: 'meson_config.h.in',
41 output: 'config.h',
42 configuration: conf_data)
Willy Tue39f9392022-06-15 13:24:20 -070043
44if not get_option('bic').disabled()
45 add_project_arguments(
46 cpp.get_supported_arguments([
47 '-DBIC_ENABLED',
48 ]),
49 language : 'cpp')
50endif
51
52root_inc = include_directories('.', 'include')
53
54# Dependencies
Patrick Williams2e9921c2022-07-25 10:17:05 -050055sdbusplus_dep = dependency('sdbusplus')
56phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
Willy Tue39f9392022-06-15 13:24:20 -070057phosphor_logging_dep = dependency('phosphor-logging')
Willy Tue39f9392022-06-15 13:24:20 -070058ipmid_dep = dependency('libipmid')
Patrick Williams2e9921c2022-07-25 10:17:05 -050059channellayer_dep = dependency('libchannellayer')
60userlayer_dep = dependency('libuserlayer')
61
Patrick Williams483f00a2023-12-07 17:05:54 -060062nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
Willy Tue39f9392022-06-15 13:24:20 -070063
64zfboemcmds_pre = declare_dependency(
65 include_directories: root_inc,
66 dependencies: [
Patrick Williams2e9921c2022-07-25 10:17:05 -050067 channellayer_dep,
68 ipmid_dep,
69 nlohmann_json_dep,
70 phosphor_dbus_interfaces_dep,
Willy Tue39f9392022-06-15 13:24:20 -070071 phosphor_logging_dep,
72 sdbusplus_dep,
Willy Tue39f9392022-06-15 13:24:20 -070073 userlayer_dep,
74 ])
75
Patrick Williams17bd2ea2022-06-24 16:44:51 -050076zfboemcmds_lib = library(
Willy Tue39f9392022-06-15 13:24:20 -070077 'zfboemcmds',
cchouxb2ae88b2023-09-13 00:35:36 +080078 'src/commandutils.cpp',
Willy Tue39f9392022-06-15 13:24:20 -070079 'src/oemcommands.cpp',
80 'src/appcommands.cpp',
81 'src/storagecommands.cpp',
82 'src/usb-dbg.cpp',
83 'src/selcommands.cpp',
84 'src/transportcommands.cpp',
85 'src/biccommands.cpp',
Potin Laid96e2702024-05-23 23:21:46 +080086 'src/groupextcommands.cpp',
Willy Tue39f9392022-06-15 13:24:20 -070087 implicit_include_directories: false,
88 dependencies: zfboemcmds_pre,
Patrick Williams17bd2ea2022-06-24 16:44:51 -050089 version: meson.project_version(),
90 override_options: ['b_lundef=false'],
Willy Tue39f9392022-06-15 13:24:20 -070091 install: true,
92 install_dir: get_option('libdir') / 'ipmid-providers')
Karthikeyan Pasupathi3048dd52022-06-30 21:51:11 +053093
94if get_option('machine') != ''
95 configfile = [
96 'cri_sensors.json',
97 'gpio_desc.json',
98 'post_desc.json'
99 ]
100 foreach c : configfile
Patrick Williams708286a2022-07-25 09:49:50 -0500101 file = join_paths('configs', get_option('machine'), c)
102 if not fs.is_file(file)
103 warning('Missing config file: ' + file)
104 else
105 install_data(
106 sources : file,
107 install_dir : get_option('datadir') / 'lcd-debug'
108 )
109 endif
Karthikeyan Pasupathi3048dd52022-06-30 21:51:11 +0530110 endforeach
111endif