blob: 5a4ec87d470ccf31c4733c022200b6d87063a147 [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',
13 'cpp_std=c++20',
14 '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 Williamsc52ee722021-10-06 15:17:42 -050028if get_option('cpp_std') != 'c++20'
29 error('This project requires c++20 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')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053059
Ed Tanousf2caadc2024-01-02 18:34:36 -080060if (get_option('tests').allowed())
Ed Tanous25b54db2024-04-17 15:40:31 -070061 summary('unittest', 'NA', section: 'Features')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053062endif
63
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053064# Add compiler arguments
65
Ed Tanousade3f092024-03-13 13:28:36 -070066if (cxx.get_id() == 'clang')
Ed Tanousf2caadc2024-01-02 18:34:36 -080067 if (cxx.version().version_compare('<17.0'))
68 error('This project requires clang-17 or higher')
69 endif
70 add_project_arguments(
71 '-Weverything',
72 '-Wformat=2',
73 '-Wno-c++98-compat-pedantic',
74 '-Wno-c++98-compat',
Ed Tanous25991f72024-06-13 18:10:25 -070075 '-Wno-c++20-extensions',
Ed Tanousf2caadc2024-01-02 18:34:36 -080076 '-Wno-documentation-unknown-command',
77 '-Wno-documentation',
78 '-Wno-exit-time-destructors',
79 '-Wno-global-constructors',
80 '-Wno-newline-eof',
81 '-Wno-padded',
82 '-Wno-shadow',
83 '-Wno-used-but-marked-unused',
84 '-Wno-weak-vtables',
85 '-Wno-switch-enum',
86 '-Wno-unused-macros',
87 '-Wno-covered-switch-default',
Ed Tanousf88b2172022-04-15 13:55:05 -070088 '-Wno-disabled-macro-expansion',
Ed Tanous724985f2024-06-05 09:19:06 -070089 '-Wno-unneeded-internal-declaration',
Ed Tanousf2caadc2024-01-02 18:34:36 -080090 language: 'cpp',
91 )
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053092endif
93
Ed Tanousade3f092024-03-13 13:28:36 -070094if (cxx.get_id() == 'gcc')
Ed Tanousf2caadc2024-01-02 18:34:36 -080095 if (cxx.version().version_compare('<13.0'))
96 error('This project requires gcc-13 or higher')
97 endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +053098
Ed Tanousf2caadc2024-01-02 18:34:36 -080099 add_project_arguments(
100 '-Wformat=2',
101 '-Wcast-align',
102 '-Wconversion',
103 '-Woverloaded-virtual',
104 '-Wsign-conversion',
105 '-Wunused',
106 '-Wduplicated-cond',
107 '-Wduplicated-branches',
108 '-Wlogical-op',
109 '-Wnull-dereference',
110 '-Wunused-parameter',
111 '-Wdouble-promotion',
112 '-Wshadow',
113 '-Wno-psabi',
114 '-Wno-attributes',
115 language: 'cpp',
116 )
Ed Tanousc66403c2021-09-22 15:28:57 -0700117endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530118
Ed Tanousc66403c2021-09-22 15:28:57 -0700119if (get_option('buildtype') != 'plain')
Ed Tanousf2caadc2024-01-02 18:34:36 -0800120 if (get_option('b_lto') == true and get_option('optimization') != '0')
121 # Reduce the binary size by removing unnecessary
122 # dynamic symbol table entries
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530123
Ed Tanousf2caadc2024-01-02 18:34:36 -0800124 add_project_arguments(
125 cxx.get_supported_arguments(
126 [
127 '-fno-fat-lto-objects',
128 '-fvisibility=hidden',
129 '-fvisibility-inlines-hidden',
130 ],
131 ),
132 language: 'cpp',
133 )
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530134
Ed Tanousf2caadc2024-01-02 18:34:36 -0800135 if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
136 add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
137 endif
George Liue8204932021-02-01 14:42:49 +0800138 endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530139endif
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530140# Set Compiler Security flags
141
142security_flags = [
Ed Tanousf2caadc2024-01-02 18:34:36 -0800143 '-fstack-protector-strong',
144 '-fPIE',
145 '-fPIC',
146 '-D_FORTIFY_SOURCE=2',
147 '-Wformat',
148 '-Wformat-security',
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530149]
150
151## Add security flags for builds of type 'release','debugoptimized' and 'minsize'
152
Ed Tanousf2caadc2024-01-02 18:34:36 -0800153if not (
154 get_option('buildtype') == 'plain'
155 or get_option('buildtype').startswith('debug')
156)
157 add_project_arguments(cxx.get_supported_arguments([security_flags]), language: 'cpp')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530158endif
159
160# Boost dependency configuration
161
162add_project_arguments(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800163 cxx.get_supported_arguments(
164 [
165 '-DBOOST_ASIO_DISABLE_CONCEPTS',
166 '-DBOOST_ALL_NO_LIB',
167 '-DBOOST_ALLOW_DEPRECATED_HEADERS',
168 '-DBOOST_ASIO_DISABLE_THREADS',
169 '-DBOOST_ASIO_NO_DEPRECATED',
170 '-DBOOST_ASIO_SEPARATE_COMPILATION',
171 '-DBOOST_BEAST_SEPARATE_COMPILATION',
172 '-DBOOST_EXCEPTION_DISABLE',
173 '-DBOOST_NO_EXCEPTIONS',
174 '-DBOOST_URL_NO_SOURCE_LOCATION',
Ed Tanousf88b2172022-04-15 13:55:05 -0700175 '-DBOOST_SPIRIT_X3_NO_RTTI',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800176 '-DJSON_NOEXCEPTION',
177 '-DOPENSSL_NO_FILENAMES',
178 '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES',
179 ],
180 ),
181 language: 'cpp',
182)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530183
184# Find the dependency modules, if not found use meson wrap to get them
185# automatically during the configure step
Jason M. Billsceb8ddc2020-11-23 14:38:39 -0800186bmcweb_dependencies = []
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530187
Nan Zhou8682c5a2021-11-13 11:00:07 -0800188pam = cxx.find_library('pam', required: true)
Ed Tanousf2caadc2024-01-02 18:34:36 -0800189atomic = cxx.find_library('atomic', required: true)
Ed Tanouse7923992023-12-03 14:14:02 -0800190bmcweb_dependencies += [pam, atomic]
191
Ed Tanousf2caadc2024-01-02 18:34:36 -0800192openssl = dependency('openssl', required: false, version: '>=3.0.0')
Ed Tanouse7923992023-12-03 14:14:02 -0800193if not openssl.found() or get_option('b_sanitize') != 'none'
Ed Tanousf2caadc2024-01-02 18:34:36 -0800194 openssl_proj = subproject(
195 'openssl',
196 required: true,
197 default_options: ['warning_level=0', 'werror=false'],
198 )
199 openssl = openssl_proj.get_variable('openssl_dep')
200 openssl = openssl.as_system('system')
Ed Tanouse7923992023-12-03 14:14:02 -0800201endif
202bmcweb_dependencies += [openssl]
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530203
Ed Tanousf2caadc2024-01-02 18:34:36 -0800204nghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false)
Ed Tanousfca2cbe2021-01-28 14:49:59 -0800205if not nghttp2.found()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800206 cmake = import('cmake')
207 opt_var = cmake.subproject_options()
Ed Tanous211cfa42024-04-17 13:43:14 -0700208 opt_var.add_cmake_defines(
209 {
210 'ENABLE_LIB_ONLY': true,
211 'ENABLE_STATIC_LIB': true,
212 },
213 )
Ed Tanousf2caadc2024-01-02 18:34:36 -0800214 nghttp2_ex = cmake.subproject('nghttp2', options: opt_var)
Ed Tanous211cfa42024-04-17 13:43:14 -0700215 nghttp2 = nghttp2_ex.dependency('nghttp2')
Ed Tanousfca2cbe2021-01-28 14:49:59 -0800216endif
217bmcweb_dependencies += nghttp2
218
Ed Tanousf2caadc2024-01-02 18:34:36 -0800219sdbusplus = dependency('sdbusplus', required: false, include_type: 'system')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530220if not sdbusplus.found()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800221 sdbusplus_proj = subproject('sdbusplus', required: true)
222 sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
223 sdbusplus = sdbusplus.as_system('system')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530224endif
Jason M. Billsceb8ddc2020-11-23 14:38:39 -0800225bmcweb_dependencies += sdbusplus
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530226
Ed Tanousc9374ff2023-05-26 09:42:08 -0700227tinyxml = dependency(
228 'tinyxml2',
Cody Smith3a097b22022-05-19 14:22:32 -0700229 include_type: 'system',
Ed Tanousc9374ff2023-05-26 09:42:08 -0700230 version: '>=9.0.0',
Konstantin Aladyshev60e299b2024-04-03 11:44:51 +0300231 default_options: ['tests=false'],
Cody Smith3a097b22022-05-19 14:22:32 -0700232)
Ed Tanousc9374ff2023-05-26 09:42:08 -0700233if not tinyxml.found()
234 tinyxml_proj = subproject('tinyxml2', required: true)
235 tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
236 tinyxml = tinyxml.as_system('system')
237endif
Cody Smith3a097b22022-05-19 14:22:32 -0700238bmcweb_dependencies += tinyxml
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530239
240systemd = dependency('systemd')
Ed Tanous055713e2024-07-17 17:19:36 -0700241add_project_arguments('-DSYSTEMD_VERSION=' + systemd.version(), language: 'cpp')
242
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530243zlib = dependency('zlib')
Jason M. Billsceb8ddc2020-11-23 14:38:39 -0800244bmcweb_dependencies += [systemd, zlib]
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530245
Patrick Williamsdfd55472023-12-07 11:50:37 -0600246nlohmann_json_dep = dependency('nlohmann_json', version: '>=3.11.2', include_type: 'system')
247bmcweb_dependencies += nlohmann_json_dep
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530248
Carson Labrado2b5b4da2023-10-18 00:02:10 +0000249boost = dependency(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800250 'boost',
251 modules: [
252 'url',
Carson Labrado2b5b4da2023-10-18 00:02:10 +0000253 ],
Ed Tanousf2caadc2024-01-02 18:34:36 -0800254 version: '>=1.84.0',
255 required: false,
256 include_type: 'system',
Carson Labrado2b5b4da2023-10-18 00:02:10 +0000257)
Ed Tanous6fd29552023-10-04 09:40:14 -0700258if boost.found()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800259 bmcweb_dependencies += [boost]
Ed Tanous6fd29552023-10-04 09:40:14 -0700260else
Ed Tanousf2caadc2024-01-02 18:34:36 -0800261 cmake = import('cmake')
262 opt = cmake.subproject_options()
Ed Tanousf80a87f2024-06-16 12:10:33 -0700263 boost_libs = [
264 'asio',
265 'beast',
266 'circular_buffer',
267 'callable_traits',
268 'headers',
269 'process',
270 'type_index',
271 'url',
272 'uuid',
273 'spirit',
274 ]
Ed Tanousf2caadc2024-01-02 18:34:36 -0800275 opt.add_cmake_defines(
276 {
Ed Tanousf80a87f2024-06-16 12:10:33 -0700277 'BOOST_INCLUDE_LIBRARIES': ';'.join(boost_libs),
Ed Tanousf2caadc2024-01-02 18:34:36 -0800278 'BUILD_SHARED_LIBS': 'OFF',
279 },
280 )
Ed Tanous144983c2024-03-28 00:39:10 -0700281
Ed Tanousf2caadc2024-01-02 18:34:36 -0800282 boost = cmake.subproject('boost', required: true, options: opt)
Ed Tanousf80a87f2024-06-16 12:10:33 -0700283 foreach boost_lib : boost_libs
284 boost_lib_instance = boost.dependency('boost_' + boost_lib).as_system()
285 bmcweb_dependencies += [boost_lib_instance]
286 endforeach
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530287endif
288
Patrick Williams549bed22023-11-29 06:45:06 -0600289if get_option('tests').allowed()
Ed Tanousf2caadc2024-01-02 18:34:36 -0800290 gtest = dependency(
291 'gtest',
292 main: true,
293 version: '>=1.14.0',
294 disabler: true,
295 required: false,
296 )
297 gmock = dependency('gmock', required: false)
298 if not gtest.found() and get_option('tests').allowed()
299 gtest_proj = subproject('gtest', required: true)
300 gtest = gtest_proj.get_variable('gtest_main_dep')
301 gmock = gtest_proj.get_variable('gmock_dep')
302 endif
303 gtest = gtest.as_system('system')
304 gmock = gmock.as_system('system')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530305endif
306
Patrick Williams4efe3e02023-04-12 08:05:58 -0500307systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530308
Ed Tanousf2caadc2024-01-02 18:34:36 -0800309bindir = get_option('prefix') + '/' + get_option('bindir')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530310
Ed Tanousf2caadc2024-01-02 18:34:36 -0800311summary(
312 {
313 'prefix': get_option('prefix'),
314 'bindir': bindir,
315 'systemd unit directory': systemd_system_unit_dir,
316 },
317 section: 'Directories',
318)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530319
Ed Tanousa529a6a2024-05-29 16:51:37 -0700320subdir('static')
321subdir('redfish-core')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530322
Nan Zhou307386e2022-10-12 20:29:34 +0000323# Config subdirectory
Nan Zhou307386e2022-10-12 20:29:34 +0000324subdir('config')
325bmcweb_dependencies += conf_h_dep
326
Ed Tanous02f1cd92021-10-27 12:09:06 -0700327# Source files
Nan Zhou0ad63df2022-10-17 23:03:21 +0000328fs = import('fs')
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530329
Nan Zhou0ad63df2022-10-17 23:03:21 +0000330srcfiles_bmcweb = files(
Ed Tanous724985f2024-06-05 09:19:06 -0700331 'http/mutual_tls.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800332 'redfish-core/src/error_messages.cpp',
Ed Tanous25991f72024-06-13 18:10:25 -0700333 'redfish-core/src/filter_expr_executor.cpp',
Ed Tanousf88b2172022-04-15 13:55:05 -0700334 'redfish-core/src/filter_expr_printer.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800335 'redfish-core/src/redfish.cpp',
336 'redfish-core/src/registries.cpp',
337 'redfish-core/src/utils/dbus_utils.cpp',
338 'redfish-core/src/utils/json_utils.cpp',
339 'redfish-core/src/utils/time_utils.cpp',
340 'src/boost_asio.cpp',
341 'src/boost_asio_ssl.cpp',
342 'src/boost_beast.cpp',
343 'src/dbus_singleton.cpp',
344 'src/json_html_serializer.cpp',
345 'src/ossl_random.cpp',
Ed Tanous724985f2024-06-05 09:19:06 -0700346 'src/ssl_key_handler.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800347 'src/webserver_run.cpp',
Nan Zhou0ad63df2022-10-17 23:03:21 +0000348)
Ed Tanous02f1cd92021-10-27 12:09:06 -0700349
Ed Tanous42bbcd82023-01-07 18:04:28 -0800350bmcweblib = static_library(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800351 'bmcweblib',
352 srcfiles_bmcweb,
353 include_directories: incdir,
354 dependencies: bmcweb_dependencies,
Ed Tanous42bbcd82023-01-07 18:04:28 -0800355)
356
Ed Tanous02f1cd92021-10-27 12:09:06 -0700357# Generate the bmcweb executable
358executable(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800359 'bmcweb',
360 'src/webserver_main.cpp',
361 include_directories: incdir,
362 dependencies: bmcweb_dependencies,
363 link_with: bmcweblib,
364 link_args: '-Wl,--gc-sections',
365 install: true,
366 install_dir: bindir,
Ed Tanous02f1cd92021-10-27 12:09:06 -0700367)
368
Nan Zhou0ad63df2022-10-17 23:03:21 +0000369srcfiles_unittest = files(
Ed Tanousf2caadc2024-01-02 18:34:36 -0800370 'test/http/crow_getroutes_test.cpp',
371 'test/http/http2_connection_test.cpp',
372 'test/http/http_body_test.cpp',
373 'test/http/http_connection_test.cpp',
374 'test/http/http_response_test.cpp',
375 'test/http/mutual_tls.cpp',
376 'test/http/mutual_tls_meta.cpp',
377 'test/http/parsing_test.cpp',
378 'test/http/router_test.cpp',
379 'test/http/server_sent_event_test.cpp',
380 'test/http/utility_test.cpp',
381 'test/http/verb_test.cpp',
382 'test/include/async_resolve_test.cpp',
383 'test/include/credential_pipe_test.cpp',
384 'test/include/dbus_utility_test.cpp',
385 'test/include/google/google_service_root_test.cpp',
386 'test/include/http_utility_test.cpp',
387 'test/include/human_sort_test.cpp',
388 'test/include/ibm/configfile_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800389 'test/include/json_html_serializer.cpp',
390 'test/include/multipart_test.cpp',
391 'test/include/openbmc_dbus_rest_test.cpp',
392 'test/include/ossl_random.cpp',
Ed Tanous099225c2024-03-27 22:03:05 -0700393 'test/include/ssl_key_handler_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800394 'test/include/str_utility_test.cpp',
395 'test/redfish-core/include/privileges_test.cpp',
Ed Tanous25991f72024-06-13 18:10:25 -0700396 'test/redfish-core/include/filter_expr_executor_test.cpp',
Ed Tanousf88b2172022-04-15 13:55:05 -0700397 'test/redfish-core/include/filter_expr_parser_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800398 'test/redfish-core/include/redfish_aggregator_test.cpp',
399 'test/redfish-core/include/registries_test.cpp',
400 'test/redfish-core/include/utils/dbus_utils.cpp',
401 'test/redfish-core/include/utils/hex_utils_test.cpp',
402 'test/redfish-core/include/utils/ip_utils_test.cpp',
403 'test/redfish-core/include/utils/json_utils_test.cpp',
404 'test/redfish-core/include/utils/query_param_test.cpp',
405 'test/redfish-core/include/utils/stl_utils_test.cpp',
406 'test/redfish-core/include/utils/time_utils_test.cpp',
407 'test/redfish-core/lib/chassis_test.cpp',
408 'test/redfish-core/lib/log_services_dump_test.cpp',
409 'test/redfish-core/lib/log_services_test.cpp',
410 'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
Ed Tanous090ab8e2024-05-18 16:07:23 -0700411 'test/redfish-core/lib/metadata_test.cpp',
Ed Tanousf2caadc2024-01-02 18:34:36 -0800412 'test/redfish-core/lib/power_subsystem_test.cpp',
413 'test/redfish-core/lib/sensors_test.cpp',
414 'test/redfish-core/lib/service_root_test.cpp',
415 'test/redfish-core/lib/system_test.cpp',
416 'test/redfish-core/lib/thermal_subsystem_test.cpp',
417 'test/redfish-core/lib/update_service_test.cpp',
Nan Zhou0ad63df2022-10-17 23:03:21 +0000418)
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530419
Ed Tanousf2caadc2024-01-02 18:34:36 -0800420if (get_option('tests').allowed())
Ed Tanous02f1cd92021-10-27 12:09:06 -0700421 # generate the test executable
Nan Zhou0ad63df2022-10-17 23:03:21 +0000422 foreach test_src : srcfiles_unittest
Ed Tanousf2caadc2024-01-02 18:34:36 -0800423 test_bin = executable(
424 fs.stem(test_src),
425 test_src,
426 link_with: bmcweblib,
427 include_directories: incdir,
428 install_dir: bindir,
429 dependencies: bmcweb_dependencies
430 + [
431 gtest,
432 gmock,
433 ],
434 )
435 test(fs.stem(test_src), test_bin)
Nan Zhou0ad63df2022-10-17 23:03:21 +0000436 endforeach
Manojkiran Edaaf6298d2020-05-27 08:51:32 +0530437endif