blob: 2eec10b78c78062c8e40bce5293dc42c07e4c654 [file] [log] [blame]
Ed Tanousf2caadc2024-01-02 18:34:36 -08001project(
2 'bmcweb',
3 'cpp',
4 version: '1.0',
Ed Tanous8dc3ddf2024-06-25 13:00:16 -07005 meson_version: '>=1.3.0',
Ed Tanousf2caadc2024-01-02 18:34:36 -08006 default_options: [
7 'b_lto_mode=default',
8 'b_lto_threads=0',
9 'b_lto=true',
10 'b_ndebug=if-release',
11 'buildtype=debugoptimized',
12 'cpp_rtti=false',
Patrick Williams921cfcd2023-08-23 06:31:07 -050013 'cpp_std=c++23',
Ed Tanousf2caadc2024-01-02 18:34:36 -080014 'warning_level=3',
15 'werror=true',
16 ],
17)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053018
19# Project related links
20
21project_pretty_name = 'bmcweb'
22project_url = 'https://github.com/openbmc/' + project_pretty_name
23project_issues_url = project_url + '/issues/new'
Ed Tanousf2caadc2024-01-02 18:34:36 -080024summary('Issues', project_issues_url, section: 'Report Issues')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053025
26# Validate the c++ Standard
27
Patrick Williams921cfcd2023-08-23 06:31:07 -050028if get_option('cpp_std') != 'c++23'
29 error('This project requires c++23 support')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053030endif
31
32# Get compiler and default build type
33
34cxx = meson.get_compiler('cpp')
35build = get_option('buildtype')
36optimization = get_option('optimization')
Ed Tanousf2caadc2024-01-02 18:34:36 -080037summary('Build Type', build, section: 'Build Info')
38summary('Optimization', optimization, section: 'Build Info')
Ed Tanous5e34b672021-02-05 14:21:27 -080039
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053040# remove debug information for minsize buildtype
Ed Tanousf2caadc2024-01-02 18:34:36 -080041if (get_option('buildtype') == 'minsize')
42 add_project_arguments(['-fdata-sections', '-ffunction-sections'], language: 'cpp')
43 add_project_arguments('-DNDEBUG', language: 'cpp')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053044endif
45
Ed Tanousf2caadc2024-01-02 18:34:36 -080046if (get_option('dns-resolver') == 'systemd-dbus')
47 add_project_arguments('-DBMCWEB_DBUS_DNS_RESOLVER', language: 'cpp')
Ed Tanousf8ca6d72022-06-28 12:12:03 -070048endif
49
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053050# Disable lto when compiling with no optimization
Ed Tanousf2caadc2024-01-02 18:34:36 -080051if (get_option('optimization') == '0')
52 add_project_arguments('-fno-lto', language: 'cpp')
53 message('Disabling lto & its supported features as optimization is disabled')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053054endif
55
56# Include Directories
57
Ed Tanousf2caadc2024-01-02 18:34:36 -080058incdir = include_directories('include', 'redfish-core/include', 'redfish-core/lib', 'http')
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -070059incdir_cli = include_directories(
60 'http',
61 'include'
62)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053063
Ed Tanousf2caadc2024-01-02 18:34:36 -080064if (get_option('tests').allowed())
Ed Tanous25b54db2024-04-17 15:40:31 -070065 summary('unittest', 'NA', section: 'Features')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053066endif
67
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053068# Add compiler arguments
69
Ed Tanousade3f092024-03-13 13:28:36 -070070if (cxx.get_id() == 'clang')
Ed Tanousf2caadc2024-01-02 18:34:36 -080071 if (cxx.version().version_compare('<17.0'))
72 error('This project requires clang-17 or higher')
73 endif
74 add_project_arguments(
75 '-Weverything',
76 '-Wformat=2',
77 '-Wno-c++98-compat-pedantic',
78 '-Wno-c++98-compat',
Ed Tanous25991f72024-06-13 18:10:25 -070079 '-Wno-c++20-extensions',
Ed Tanousf2caadc2024-01-02 18:34:36 -080080 '-Wno-documentation-unknown-command',
81 '-Wno-documentation',
82 '-Wno-exit-time-destructors',
83 '-Wno-global-constructors',
84 '-Wno-newline-eof',
85 '-Wno-padded',
86 '-Wno-shadow',
87 '-Wno-used-but-marked-unused',
88 '-Wno-weak-vtables',
89 '-Wno-switch-enum',
90 '-Wno-unused-macros',
91 '-Wno-covered-switch-default',
Ed Tanousf88b2172022-04-15 13:55:05 -070092 '-Wno-disabled-macro-expansion',
Ed Tanous724985f2024-06-05 09:19:06 -070093 '-Wno-unneeded-internal-declaration',
Ed Tanousf2caadc2024-01-02 18:34:36 -080094 language: 'cpp',
95 )
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053096endif
97
Ed Tanousade3f092024-03-13 13:28:36 -070098if (cxx.get_id() == 'gcc')
Ed Tanousf2caadc2024-01-02 18:34:36 -080099 if (cxx.version().version_compare('<13.0'))
100 error('This project requires gcc-13 or higher')
101 endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530102
Ed Tanousf2caadc2024-01-02 18:34:36 -0800103 add_project_arguments(
104 '-Wformat=2',
105 '-Wcast-align',
106 '-Wconversion',
107 '-Woverloaded-virtual',
108 '-Wsign-conversion',
109 '-Wunused',
110 '-Wduplicated-cond',
111 '-Wduplicated-branches',
112 '-Wlogical-op',
113 '-Wnull-dereference',
114 '-Wunused-parameter',
115 '-Wdouble-promotion',
116 '-Wshadow',
117 '-Wno-psabi',
118 '-Wno-attributes',
119 language: 'cpp',
120 )
Ed Tanousc66403c2021-09-22 15:28:57 -0700121endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530122
Ed Tanousc66403c2021-09-22 15:28:57 -0700123if (get_option('buildtype') != 'plain')
Ed Tanousf2caadc2024-01-02 18:34:36 -0800124 if (get_option('b_lto') == true and get_option('optimization') != '0')
125 # Reduce the binary size by removing unnecessary
126 # dynamic symbol table entries
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530127
Ed Tanousf2caadc2024-01-02 18:34:36 -0800128 add_project_arguments(
129 cxx.get_supported_arguments(
130 [
131 '-fno-fat-lto-objects',
132 '-fvisibility=hidden',
133 '-fvisibility-inlines-hidden',
134 ],
135 ),
136 language: 'cpp',
137 )
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530138
Ed Tanousf2caadc2024-01-02 18:34:36 -0800139 if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
140 add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
141 endif
George Liue8204932021-02-01 14:42:49 +0800142 endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530143endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530144# Set Compiler Security flags
145
146security_flags = [
Ed Tanousf2caadc2024-01-02 18:34:36 -0800147 '-fstack-protector-strong',
148 '-fPIE',
149 '-fPIC',
150 '-D_FORTIFY_SOURCE=2',
151 '-Wformat',
152 '-Wformat-security',
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530153]
154
155## Add security flags for builds of type 'release','debugoptimized' and 'minsize'
156
Ed Tanousf2caadc2024-01-02 18:34:36 -0800157if not (
158 get_option('buildtype') == 'plain'
159 or get_option('buildtype').startswith('debug')
160)
161 add_project_arguments(cxx.get_supported_arguments([security_flags]), language: 'cpp')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530162endif
163
164# Boost dependency configuration
165
166add_project_arguments(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800167 cxx.get_supported_arguments(
168 [
169 '-DBOOST_ASIO_DISABLE_CONCEPTS',
170 '-DBOOST_ALL_NO_LIB',
171 '-DBOOST_ALLOW_DEPRECATED_HEADERS',
172 '-DBOOST_ASIO_DISABLE_THREADS',
173 '-DBOOST_ASIO_NO_DEPRECATED',
174 '-DBOOST_ASIO_SEPARATE_COMPILATION',
175 '-DBOOST_BEAST_SEPARATE_COMPILATION',
176 '-DBOOST_EXCEPTION_DISABLE',
177 '-DBOOST_NO_EXCEPTIONS',
178 '-DBOOST_URL_NO_SOURCE_LOCATION',
Ed Tanousf88b2172022-04-15 13:55:05 -0700179 '-DBOOST_SPIRIT_X3_NO_RTTI',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800180 '-DJSON_NOEXCEPTION',
181 '-DOPENSSL_NO_FILENAMES',
182 '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES',
183 ],
184 ),
185 language: 'cpp',
186)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530187
188# Find the dependency modules, if not found use meson wrap to get them
189# automatically during the configure step
Jason M. Billsceb8ddc2020-11-23 14:38:39 -0800190bmcweb_dependencies = []
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700191bmcweb_cli_dependencies = []
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530192
Nan Zhou8682c5a2021-11-13 11:00:07 -0800193pam = cxx.find_library('pam', required: true)
Ed Tanousf2caadc2024-01-02 18:34:36 -0800194atomic = cxx.find_library('atomic', required: true)
Ed Tanouse7923992023-12-03 14:14:02 -0800195bmcweb_dependencies += [pam, atomic]
196
Ed Tanousf2caadc2024-01-02 18:34:36 -0800197openssl = dependency('openssl', required: false, version: '>=3.0.0')
Ed Tanouse7923992023-12-03 14:14:02 -0800198if not openssl.found() or get_option('b_sanitize') != 'none'
Ed Tanousf2caadc2024-01-02 18:34:36 -0800199 openssl_proj = subproject(
200 'openssl',
201 required: true,
202 default_options: ['warning_level=0', 'werror=false'],
203 )
204 openssl = openssl_proj.get_variable('openssl_dep')
205 openssl = openssl.as_system('system')
Ed Tanouse7923992023-12-03 14:14:02 -0800206endif
207bmcweb_dependencies += [openssl]
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530208
Ed Tanousf2caadc2024-01-02 18:34:36 -0800209nghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false)
Ed Tanousfca2cbe2021-01-28 14:49:59 -0800210if not nghttp2.found()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800211 cmake = import('cmake')
212 opt_var = cmake.subproject_options()
Ed Tanous211cfa42024-04-17 13:43:14 -0700213 opt_var.add_cmake_defines(
214 {
215 'ENABLE_LIB_ONLY': true,
216 'ENABLE_STATIC_LIB': true,
217 },
218 )
Ed Tanousf2caadc2024-01-02 18:34:36 -0800219 nghttp2_ex = cmake.subproject('nghttp2', options: opt_var)
Ed Tanous211cfa42024-04-17 13:43:14 -0700220 nghttp2 = nghttp2_ex.dependency('nghttp2')
Ed Tanousfca2cbe2021-01-28 14:49:59 -0800221endif
222bmcweb_dependencies += nghttp2
223
Ed Tanousf2caadc2024-01-02 18:34:36 -0800224sdbusplus = dependency('sdbusplus', required: false, include_type: 'system')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530225if not sdbusplus.found()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800226 sdbusplus_proj = subproject('sdbusplus', required: true)
227 sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
228 sdbusplus = sdbusplus.as_system('system')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530229endif
Jason M. Billsceb8ddc2020-11-23 14:38:39 -0800230bmcweb_dependencies += sdbusplus
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700231bmcweb_cli_dependencies += sdbusplus
232
233cli11 = dependency('CLI11', required : false, include_type: 'system')
234if not cli11.found()
235 cli11_proj = subproject('cli11', required: true)
236 cli11 = cli11_proj.get_variable('CLI11_dep')
237 cli11 = cli11.as_system('system')
238endif
239bmcweb_cli_dependencies += cli11
240
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530241
Ed Tanousc9374ff2023-05-26 09:42:08 -0700242tinyxml = dependency(
243 'tinyxml2',
Cody Smith3a097b22022-05-19 14:22:32 -0700244 include_type: 'system',
Ed Tanousc9374ff2023-05-26 09:42:08 -0700245 version: '>=9.0.0',
Konstantin Aladyshev60e299b2024-04-03 11:44:51 +0300246 default_options: ['tests=false'],
Cody Smith3a097b22022-05-19 14:22:32 -0700247)
Ed Tanousc9374ff2023-05-26 09:42:08 -0700248if not tinyxml.found()
249 tinyxml_proj = subproject('tinyxml2', required: true)
250 tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
251 tinyxml = tinyxml.as_system('system')
252endif
Cody Smith3a097b22022-05-19 14:22:32 -0700253bmcweb_dependencies += tinyxml
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530254
255systemd = dependency('systemd')
Ed Tanous055713e2024-07-17 17:19:36 -0700256add_project_arguments('-DSYSTEMD_VERSION=' + systemd.version(), language: 'cpp')
257
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530258zlib = dependency('zlib')
Jason M. Billsceb8ddc2020-11-23 14:38:39 -0800259bmcweb_dependencies += [systemd, zlib]
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530260
Patrick Williamsdfd55472023-12-07 11:50:37 -0600261nlohmann_json_dep = dependency('nlohmann_json', version: '>=3.11.2', include_type: 'system')
262bmcweb_dependencies += nlohmann_json_dep
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530263
Carson Labrado2b5b4da2023-10-18 00:02:10 +0000264boost = dependency(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800265 'boost',
266 modules: [
267 'url',
Carson Labrado2b5b4da2023-10-18 00:02:10 +0000268 ],
Ed Tanousf2caadc2024-01-02 18:34:36 -0800269 version: '>=1.84.0',
270 required: false,
271 include_type: 'system',
Carson Labrado2b5b4da2023-10-18 00:02:10 +0000272)
Ed Tanous6fd29552023-10-04 09:40:14 -0700273if boost.found()
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700274 bmcweb_dependencies += [boost]
275 bmcweb_cli_dependencies += [boost]
Ed Tanous6fd29552023-10-04 09:40:14 -0700276else
Ed Tanousf2caadc2024-01-02 18:34:36 -0800277 cmake = import('cmake')
278 opt = cmake.subproject_options()
Ed Tanousf80a87f2024-06-16 12:10:33 -0700279 boost_libs = [
280 'asio',
281 'beast',
282 'circular_buffer',
283 'callable_traits',
284 'headers',
285 'process',
286 'type_index',
287 'url',
288 'uuid',
289 'spirit',
290 ]
Ed Tanousf2caadc2024-01-02 18:34:36 -0800291 opt.add_cmake_defines(
292 {
Ed Tanous4ed30a82024-08-19 11:46:20 -0700293 # 1.86.0 fails this. Hopefully fixed in 1.86.1
294 'CMAKE_CXX_FLAGS': '-Wno-unused-parameter',
Ed Tanousf80a87f2024-06-16 12:10:33 -0700295 'BOOST_INCLUDE_LIBRARIES': ';'.join(boost_libs),
Ed Tanousf2caadc2024-01-02 18:34:36 -0800296 'BUILD_SHARED_LIBS': 'OFF',
297 },
298 )
Ed Tanous144983c2024-03-28 00:39:10 -0700299
Ed Tanousf2caadc2024-01-02 18:34:36 -0800300 boost = cmake.subproject('boost', required: true, options: opt)
Ed Tanousf80a87f2024-06-16 12:10:33 -0700301 foreach boost_lib : boost_libs
302 boost_lib_instance = boost.dependency('boost_' + boost_lib).as_system()
303 bmcweb_dependencies += [boost_lib_instance]
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700304 bmcweb_cli_dependencies += [boost_lib_instance]
Ed Tanousf80a87f2024-06-16 12:10:33 -0700305 endforeach
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530306endif
307
Patrick Williams549bed22023-11-29 06:45:06 -0600308if get_option('tests').allowed()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800309 gtest = dependency(
310 'gtest',
311 main: true,
312 version: '>=1.14.0',
313 disabler: true,
314 required: false,
315 )
316 gmock = dependency('gmock', required: false)
317 if not gtest.found() and get_option('tests').allowed()
318 gtest_proj = subproject('gtest', required: true)
319 gtest = gtest_proj.get_variable('gtest_main_dep')
320 gmock = gtest_proj.get_variable('gmock_dep')
321 endif
322 gtest = gtest.as_system('system')
323 gmock = gmock.as_system('system')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530324endif
325
Patrick Williams4efe3e02023-04-12 08:05:58 -0500326systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530327
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700328bindir = get_option('prefix') + '/' +get_option('bindir')
329libexec = get_option('prefix') + '/' + get_option('libexecdir')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530330
Ed Tanousf2caadc2024-01-02 18:34:36 -0800331summary(
332 {
333 'prefix': get_option('prefix'),
334 'bindir': bindir,
335 'systemd unit directory': systemd_system_unit_dir,
336 },
337 section: 'Directories',
338)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530339
Ed Tanousa529a6a2024-05-29 16:51:37 -0700340subdir('static')
341subdir('redfish-core')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530342
Nan Zhou307386e2022-10-12 20:29:34 +0000343# Config subdirectory
Nan Zhou307386e2022-10-12 20:29:34 +0000344subdir('config')
345bmcweb_dependencies += conf_h_dep
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700346bmcweb_cli_dependencies += conf_h_dep
Nan Zhou307386e2022-10-12 20:29:34 +0000347
Ed Tanous02f1cd92021-10-27 12:09:06 -0700348# Source files
Nan Zhou0ad63df2022-10-17 23:03:21 +0000349fs = import('fs')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530350
Nan Zhou0ad63df2022-10-17 23:03:21 +0000351srcfiles_bmcweb = files(
Ed Tanous724985f2024-06-05 09:19:06 -0700352 'http/mutual_tls.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800353 'redfish-core/src/error_messages.cpp',
Ed Tanous25991f72024-06-13 18:10:25 -0700354 'redfish-core/src/filter_expr_executor.cpp',
Ed Tanousf88b2172022-04-15 13:55:05 -0700355 'redfish-core/src/filter_expr_printer.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800356 'redfish-core/src/redfish.cpp',
357 'redfish-core/src/registries.cpp',
358 'redfish-core/src/utils/dbus_utils.cpp',
359 'redfish-core/src/utils/json_utils.cpp',
360 'redfish-core/src/utils/time_utils.cpp',
361 'src/boost_asio.cpp',
362 'src/boost_asio_ssl.cpp',
363 'src/boost_beast.cpp',
364 'src/dbus_singleton.cpp',
365 'src/json_html_serializer.cpp',
366 'src/ossl_random.cpp',
Ed Tanous724985f2024-06-05 09:19:06 -0700367 'src/ssl_key_handler.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800368 'src/webserver_run.cpp',
Nan Zhou0ad63df2022-10-17 23:03:21 +0000369)
Ed Tanous02f1cd92021-10-27 12:09:06 -0700370
Ed Tanous42bbcd82023-01-07 18:04:28 -0800371bmcweblib = static_library(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800372 'bmcweblib',
373 srcfiles_bmcweb,
374 include_directories: incdir,
375 dependencies: bmcweb_dependencies,
Ed Tanous42bbcd82023-01-07 18:04:28 -0800376)
377
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700378# Generate the bmcwebd daemon
Ed Tanous02f1cd92021-10-27 12:09:06 -0700379executable(
Aushim Nagarkattibd1299b2024-08-12 17:11:04 -0700380 'bmcwebd',
381 'src/webserver_main.cpp',
382 include_directories : incdir,
383 dependencies: bmcweb_dependencies,
384 link_with: bmcweblib,
385 link_args: '-Wl,--gc-sections',
386 install: true,
387 install_dir:libexec
388)
389
390# Generate the bmcweb CLI application
391executable(
392 'bmcweb',
393 ['src/webserver_cli.cpp','src/boost_asio.cpp'],
394 include_directories : incdir_cli,
395 dependencies: bmcweb_cli_dependencies,
396 install: true,
397 install_dir:bindir
Ed Tanous02f1cd92021-10-27 12:09:06 -0700398)
399
Nan Zhou0ad63df2022-10-17 23:03:21 +0000400srcfiles_unittest = files(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800401 'test/http/crow_getroutes_test.cpp',
402 'test/http/http2_connection_test.cpp',
403 'test/http/http_body_test.cpp',
404 'test/http/http_connection_test.cpp',
405 'test/http/http_response_test.cpp',
406 'test/http/mutual_tls.cpp',
407 'test/http/mutual_tls_meta.cpp',
408 'test/http/parsing_test.cpp',
409 'test/http/router_test.cpp',
410 'test/http/server_sent_event_test.cpp',
411 'test/http/utility_test.cpp',
412 'test/http/verb_test.cpp',
413 'test/include/async_resolve_test.cpp',
414 'test/include/credential_pipe_test.cpp',
415 'test/include/dbus_utility_test.cpp',
416 'test/include/google/google_service_root_test.cpp',
417 'test/include/http_utility_test.cpp',
418 'test/include/human_sort_test.cpp',
419 'test/include/ibm/configfile_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800420 'test/include/json_html_serializer.cpp',
421 'test/include/multipart_test.cpp',
422 'test/include/openbmc_dbus_rest_test.cpp',
423 'test/include/ossl_random.cpp',
Ed Tanous099225c2024-03-27 22:03:05 -0700424 'test/include/ssl_key_handler_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800425 'test/include/str_utility_test.cpp',
426 'test/redfish-core/include/privileges_test.cpp',
Ed Tanous25991f72024-06-13 18:10:25 -0700427 'test/redfish-core/include/filter_expr_executor_test.cpp',
Ed Tanousf88b2172022-04-15 13:55:05 -0700428 'test/redfish-core/include/filter_expr_parser_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800429 'test/redfish-core/include/redfish_aggregator_test.cpp',
430 'test/redfish-core/include/registries_test.cpp',
431 'test/redfish-core/include/utils/dbus_utils.cpp',
432 'test/redfish-core/include/utils/hex_utils_test.cpp',
433 'test/redfish-core/include/utils/ip_utils_test.cpp',
434 'test/redfish-core/include/utils/json_utils_test.cpp',
435 'test/redfish-core/include/utils/query_param_test.cpp',
Janet Adkins1516c212024-08-14 13:22:41 -0500436 'test/redfish-core/include/utils/sensor_utils_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800437 'test/redfish-core/include/utils/stl_utils_test.cpp',
438 'test/redfish-core/include/utils/time_utils_test.cpp',
439 'test/redfish-core/lib/chassis_test.cpp',
440 'test/redfish-core/lib/log_services_dump_test.cpp',
441 'test/redfish-core/lib/log_services_test.cpp',
442 'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
Ed Tanous090ab8e2024-05-18 16:07:23 -0700443 'test/redfish-core/lib/metadata_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800444 'test/redfish-core/lib/power_subsystem_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800445 'test/redfish-core/lib/service_root_test.cpp',
446 'test/redfish-core/lib/system_test.cpp',
447 'test/redfish-core/lib/thermal_subsystem_test.cpp',
448 'test/redfish-core/lib/update_service_test.cpp',
Nan Zhou0ad63df2022-10-17 23:03:21 +0000449)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530450
Ed Tanousf2caadc2024-01-02 18:34:36 -0800451if (get_option('tests').allowed())
Ed Tanous02f1cd92021-10-27 12:09:06 -0700452 # generate the test executable
Nan Zhou0ad63df2022-10-17 23:03:21 +0000453 foreach test_src : srcfiles_unittest
Ed Tanousf2caadc2024-01-02 18:34:36 -0800454 test_bin = executable(
455 fs.stem(test_src),
456 test_src,
457 link_with: bmcweblib,
458 include_directories: incdir,
459 install_dir: bindir,
460 dependencies: bmcweb_dependencies
461 + [
462 gtest,
463 gmock,
464 ],
465 )
466 test(fs.stem(test_src), test_bin)
Nan Zhou0ad63df2022-10-17 23:03:21 +0000467 endforeach
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530468endif