xref: /openbmc/bmcweb/meson.build (revision 4ed30a8b4c93bbae2362ceffba41abb60a11ab6b)
1f2caadceSEd Tanousproject(
2f2caadceSEd Tanous    'bmcweb',
3f2caadceSEd Tanous    'cpp',
4af6298daSManojkiran Eda    version: '1.0',
58dc3ddf6SEd Tanous    meson_version: '>=1.3.0',
6af6298daSManojkiran Eda    default_options: [
7cb2ed190SManojkiran Eda        'b_lto_mode=default',
8f523c324SEd Tanous        'b_lto_threads=0',
9f523c324SEd Tanous        'b_lto=true',
10f523c324SEd Tanous        'b_ndebug=if-release',
11f523c324SEd Tanous        'buildtype=debugoptimized',
12f523c324SEd Tanous        'cpp_rtti=false',
13921cfcd1SPatrick Williams        'cpp_std=c++23',
14f523c324SEd Tanous        'warning_level=3',
15f523c324SEd Tanous        'werror=true',
16f2caadceSEd Tanous    ],
17f2caadceSEd Tanous)
18af6298daSManojkiran Eda
19af6298daSManojkiran Eda# Project related links
20af6298daSManojkiran Eda
21af6298daSManojkiran Edaproject_pretty_name = 'bmcweb'
22af6298daSManojkiran Edaproject_url = 'https://github.com/openbmc/' + project_pretty_name
23af6298daSManojkiran Edaproject_issues_url = project_url + '/issues/new'
24af6298daSManojkiran Edasummary('Issues', project_issues_url, section: 'Report Issues')
25af6298daSManojkiran Eda
26af6298daSManojkiran Eda# Validate the c++ Standard
27af6298daSManojkiran Eda
28921cfcd1SPatrick Williamsif get_option('cpp_std') != 'c++23'
29921cfcd1SPatrick Williams    error('This project requires c++23 support')
30af6298daSManojkiran Edaendif
31af6298daSManojkiran Eda
32af6298daSManojkiran Eda# Get compiler and default build type
33af6298daSManojkiran Eda
34af6298daSManojkiran Edacxx = meson.get_compiler('cpp')
35af6298daSManojkiran Edabuild = get_option('buildtype')
36af6298daSManojkiran Edaoptimization = get_option('optimization')
37af6298daSManojkiran Edasummary('Build Type', build, section: 'Build Info')
38af6298daSManojkiran Edasummary('Optimization', optimization, section: 'Build Info')
39af6298daSManojkiran Eda
40af6298daSManojkiran Eda# remove debug information for minsize buildtype
41af6298daSManojkiran Edaif (get_option('buildtype') == 'minsize')
425e34b67aSEd Tanous    add_project_arguments(['-fdata-sections', '-ffunction-sections'], language: 'cpp')
43af6298daSManojkiran Eda    add_project_arguments('-DNDEBUG', language: 'cpp')
44af6298daSManojkiran Edaendif
45af6298daSManojkiran Eda
46f8ca6d79SEd Tanousif (get_option('dns-resolver') == 'systemd-dbus')
47f8ca6d79SEd Tanous    add_project_arguments('-DBMCWEB_DBUS_DNS_RESOLVER', language: 'cpp')
48f8ca6d79SEd Tanousendif
49f8ca6d79SEd Tanous
50af6298daSManojkiran Eda# Disable lto when compiling with no optimization
51af6298daSManojkiran Edaif (get_option('optimization') == '0')
52af6298daSManojkiran Eda    add_project_arguments('-fno-lto', language: 'cpp')
53af6298daSManojkiran Eda    message('Disabling lto & its supported features as optimization is disabled')
54af6298daSManojkiran Edaendif
55af6298daSManojkiran Eda
56af6298daSManojkiran Eda# Include Directories
57af6298daSManojkiran Eda
58f2caadceSEd Tanousincdir = include_directories('include', 'redfish-core/include', 'redfish-core/lib', 'http')
59af6298daSManojkiran Eda
60549bed29SPatrick Williamsif (get_option('tests').allowed())
6125b54dbaSEd Tanous    summary('unittest', 'NA', section: 'Features')
62af6298daSManojkiran Edaendif
63af6298daSManojkiran Eda
64af6298daSManojkiran Eda# Add compiler arguments
65af6298daSManojkiran Eda
66ade3f093SEd Tanousif (cxx.get_id() == 'clang')
67ade3f093SEd Tanous    if (cxx.version().version_compare('<17.0'))
68ade3f093SEd Tanous        error('This project requires clang-17 or higher')
69ade3f093SEd Tanous    endif
70af6298daSManojkiran Eda    add_project_arguments(
71af6298daSManojkiran Eda        '-Weverything',
72ade3f093SEd Tanous        '-Wformat=2',
73af6298daSManojkiran Eda        '-Wno-c++98-compat-pedantic',
74f523c324SEd Tanous        '-Wno-c++98-compat',
7525991f7dSEd Tanous        '-Wno-c++20-extensions',
76f523c324SEd Tanous        '-Wno-documentation-unknown-command',
77f523c324SEd Tanous        '-Wno-documentation',
78af6298daSManojkiran Eda        '-Wno-exit-time-destructors',
79f523c324SEd Tanous        '-Wno-global-constructors',
80f523c324SEd Tanous        '-Wno-newline-eof',
81f523c324SEd Tanous        '-Wno-padded',
82af6298daSManojkiran Eda        '-Wno-shadow',
83af6298daSManojkiran Eda        '-Wno-used-but-marked-unused',
84af6298daSManojkiran Eda        '-Wno-weak-vtables',
85e6801eb4SEd Tanous        '-Wno-switch-enum',
8672b90760SEd Tanous        '-Wno-unused-macros',
874da0490bSEd Tanous        '-Wno-covered-switch-default',
88f88b2170SEd Tanous        '-Wno-disabled-macro-expansion',
89724985ffSEd Tanous        '-Wno-unneeded-internal-declaration',
90f2caadceSEd Tanous        language: 'cpp',
91f2caadceSEd Tanous    )
92af6298daSManojkiran Edaendif
93af6298daSManojkiran Eda
94ade3f093SEd Tanousif (cxx.get_id() == 'gcc')
95ade3f093SEd Tanous    if (cxx.version().version_compare('<13.0'))
96ade3f093SEd Tanous        error('This project requires gcc-13 or higher')
97ade3f093SEd Tanous    endif
98af6298daSManojkiran Eda
99af6298daSManojkiran Eda    add_project_arguments(
100ade3f093SEd Tanous        '-Wformat=2',
101ade3f093SEd Tanous        '-Wcast-align',
102ade3f093SEd Tanous        '-Wconversion',
103ade3f093SEd Tanous        '-Woverloaded-virtual',
104ade3f093SEd Tanous        '-Wsign-conversion',
105ade3f093SEd Tanous        '-Wunused',
106af6298daSManojkiran Eda        '-Wduplicated-cond',
107af6298daSManojkiran Eda        '-Wduplicated-branches',
108af6298daSManojkiran Eda        '-Wlogical-op',
109af6298daSManojkiran Eda        '-Wnull-dereference',
110079360aeSEd Tanous        '-Wunused-parameter',
111af6298daSManojkiran Eda        '-Wdouble-promotion',
1128a592810SEd Tanous        '-Wshadow',
11330f11eb4SEd Tanous        '-Wno-psabi',
114ade3f093SEd Tanous        '-Wno-attributes',
115f2caadceSEd Tanous        language: 'cpp',
116f2caadceSEd Tanous    )
117c66403c3SEd Tanousendif
118af6298daSManojkiran Eda
119af6298daSManojkiran Edaif (get_option('buildtype') != 'plain')
120af6298daSManojkiran Eda    if (get_option('b_lto') == true and get_option('optimization') != '0')
121af6298daSManojkiran Eda        # Reduce the binary size by removing unnecessary
122af6298daSManojkiran Eda        # dynamic symbol table entries
123af6298daSManojkiran Eda
124af6298daSManojkiran Eda        add_project_arguments(
125f2caadceSEd Tanous            cxx.get_supported_arguments(
126f2caadceSEd Tanous                [
127af6298daSManojkiran Eda                    '-fno-fat-lto-objects',
128af6298daSManojkiran Eda                    '-fvisibility=hidden',
129f2caadceSEd Tanous                    '-fvisibility-inlines-hidden',
130f2caadceSEd Tanous                ],
131f2caadceSEd Tanous            ),
132f2caadceSEd Tanous            language: 'cpp',
133f2caadceSEd Tanous        )
134af6298daSManojkiran Eda
135af6298daSManojkiran Eda        if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
136af6298daSManojkiran Eda            add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
137af6298daSManojkiran Eda        endif
138af6298daSManojkiran Eda    endif
139c66403c3SEd Tanousendif
140af6298daSManojkiran Eda# Set Compiler Security flags
141af6298daSManojkiran Eda
142af6298daSManojkiran Edasecurity_flags = [
143af6298daSManojkiran Eda    '-fstack-protector-strong',
144af6298daSManojkiran Eda    '-fPIE',
145af6298daSManojkiran Eda    '-fPIC',
146af6298daSManojkiran Eda    '-D_FORTIFY_SOURCE=2',
147af6298daSManojkiran Eda    '-Wformat',
148f2caadceSEd Tanous    '-Wformat-security',
149af6298daSManojkiran Eda]
150af6298daSManojkiran Eda
151af6298daSManojkiran Eda## Add security flags for builds of type 'release','debugoptimized' and 'minsize'
152af6298daSManojkiran Eda
153f2caadceSEd Tanousif not (
154f2caadceSEd Tanous    get_option('buildtype') == 'plain'
155f2caadceSEd Tanous    or get_option('buildtype').startswith('debug')
156f2caadceSEd Tanous)
157f2caadceSEd Tanous    add_project_arguments(cxx.get_supported_arguments([security_flags]), language: 'cpp')
158af6298daSManojkiran Edaendif
159af6298daSManojkiran Eda
160af6298daSManojkiran Eda# Boost dependency configuration
161af6298daSManojkiran Eda
162af6298daSManojkiran Edaadd_project_arguments(
163f2caadceSEd Tanous    cxx.get_supported_arguments(
164f2caadceSEd Tanous        [
1656fd29553SEd Tanous            '-DBOOST_ASIO_DISABLE_CONCEPTS',
166af6298daSManojkiran Eda            '-DBOOST_ALL_NO_LIB',
16758e42b18SEd Tanous            '-DBOOST_ALLOW_DEPRECATED_HEADERS',
168f523c324SEd Tanous            '-DBOOST_ASIO_DISABLE_THREADS',
169f523c324SEd Tanous            '-DBOOST_ASIO_NO_DEPRECATED',
170f523c324SEd Tanous            '-DBOOST_ASIO_SEPARATE_COMPILATION',
171f523c324SEd Tanous            '-DBOOST_BEAST_SEPARATE_COMPILATION',
1729e710e7fSEd Tanous            '-DBOOST_EXCEPTION_DISABLE',
173f706551dSEd Tanous            '-DBOOST_NO_EXCEPTIONS',
174ab6b6fecSEd Tanous            '-DBOOST_URL_NO_SOURCE_LOCATION',
175f88b2170SEd Tanous            '-DBOOST_SPIRIT_X3_NO_RTTI',
1769e710e7fSEd Tanous            '-DJSON_NOEXCEPTION',
177209aa909SEd Tanous            '-DOPENSSL_NO_FILENAMES',
178f706551dSEd Tanous            '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES',
179f2caadceSEd Tanous        ],
180f2caadceSEd Tanous    ),
181f2caadceSEd Tanous    language: 'cpp',
182f2caadceSEd Tanous)
183af6298daSManojkiran Eda
184af6298daSManojkiran Eda# Find the dependency modules, if not found use meson wrap to get them
185af6298daSManojkiran Eda# automatically during the configure step
186ceb8ddc1SJason M. Billsbmcweb_dependencies = []
187af6298daSManojkiran Eda
1888682c5adSNan Zhoupam = cxx.find_library('pam', required: true)
189af6298daSManojkiran Edaatomic = cxx.find_library('atomic', required: true)
190e7923997SEd Tanousbmcweb_dependencies += [pam, atomic]
191e7923997SEd Tanous
192e7923997SEd Tanousopenssl = dependency('openssl', required: false, version: '>=3.0.0')
193e7923997SEd Tanousif not openssl.found() or get_option('b_sanitize') != 'none'
194e7923997SEd Tanous    openssl_proj = subproject(
195e7923997SEd Tanous        'openssl',
196e7923997SEd Tanous        required: true,
197f2caadceSEd Tanous        default_options: ['warning_level=0', 'werror=false'],
198e7923997SEd Tanous    )
199e7923997SEd Tanous    openssl = openssl_proj.get_variable('openssl_dep')
200e7923997SEd Tanous    openssl = openssl.as_system('system')
201e7923997SEd Tanousendif
202e7923997SEd Tanousbmcweb_dependencies += [openssl]
203af6298daSManojkiran Eda
204fca2cbeaSEd Tanousnghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false)
205fca2cbeaSEd Tanousif not nghttp2.found()
206fca2cbeaSEd Tanous    cmake = import('cmake')
207fca2cbeaSEd Tanous    opt_var = cmake.subproject_options()
208211cfa49SEd Tanous    opt_var.add_cmake_defines(
209211cfa49SEd Tanous        {
210211cfa49SEd Tanous            'ENABLE_LIB_ONLY': true,
211211cfa49SEd Tanous            'ENABLE_STATIC_LIB': true,
212211cfa49SEd Tanous        },
213211cfa49SEd Tanous    )
214fca2cbeaSEd Tanous    nghttp2_ex = cmake.subproject('nghttp2', options: opt_var)
215211cfa49SEd Tanous    nghttp2 = nghttp2_ex.dependency('nghttp2')
216fca2cbeaSEd Tanousendif
217fca2cbeaSEd Tanousbmcweb_dependencies += nghttp2
218fca2cbeaSEd Tanous
2197bb985eeSEd Tanoussdbusplus = dependency('sdbusplus', required: false, include_type: 'system')
220af6298daSManojkiran Edaif not sdbusplus.found()
221af6298daSManojkiran Eda    sdbusplus_proj = subproject('sdbusplus', required: true)
222af6298daSManojkiran Eda    sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
223af6298daSManojkiran Eda    sdbusplus = sdbusplus.as_system('system')
224af6298daSManojkiran Edaendif
225ceb8ddc1SJason M. Billsbmcweb_dependencies += sdbusplus
226af6298daSManojkiran Eda
227c9374ff6SEd Tanoustinyxml = dependency(
228c9374ff6SEd Tanous    'tinyxml2',
229565c0911SPatrick Williams    include_type: 'system',
230c9374ff6SEd Tanous    version: '>=9.0.0',
23160e299bdSKonstantin Aladyshev    default_options: ['tests=false'],
232565c0911SPatrick Williams)
233c9374ff6SEd Tanousif not tinyxml.found()
234c9374ff6SEd Tanous    tinyxml_proj = subproject('tinyxml2', required: true)
235c9374ff6SEd Tanous    tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
236c9374ff6SEd Tanous    tinyxml = tinyxml.as_system('system')
237c9374ff6SEd Tanousendif
238ceb8ddc1SJason M. Billsbmcweb_dependencies += tinyxml
239af6298daSManojkiran Eda
240af6298daSManojkiran Edasystemd = dependency('systemd')
241055713e4SEd Tanousadd_project_arguments('-DSYSTEMD_VERSION=' + systemd.version(), language: 'cpp')
242055713e4SEd Tanous
243af6298daSManojkiran Edazlib = dependency('zlib')
244ceb8ddc1SJason M. Billsbmcweb_dependencies += [systemd, zlib]
245af6298daSManojkiran Eda
246dfd5547bSPatrick Williamsnlohmann_json_dep = dependency('nlohmann_json', version: '>=3.11.2', include_type: 'system')
247dfd5547bSPatrick Williamsbmcweb_dependencies += nlohmann_json_dep
248af6298daSManojkiran Eda
2492b5b4daeSCarson Labradoboost = dependency(
2502b5b4daeSCarson Labrado    'boost',
2512b5b4daeSCarson Labrado    modules: [
2522b5b4daeSCarson Labrado        'url',
2532b5b4daeSCarson Labrado    ],
254619b8609SEd Tanous    version: '>=1.84.0',
2552b5b4daeSCarson Labrado    required: false,
256f2caadceSEd Tanous    include_type: 'system',
2572b5b4daeSCarson Labrado)
2586fd29553SEd Tanousif boost.found()
2596fd29553SEd Tanous    bmcweb_dependencies += [boost]
2606fd29553SEd Tanouselse
2616fd29553SEd Tanous    cmake = import('cmake')
2626fd29553SEd Tanous    opt = cmake.subproject_options()
263f80a87f2SEd Tanous    boost_libs = [
264f80a87f2SEd Tanous        'asio',
265f80a87f2SEd Tanous        'beast',
266f80a87f2SEd Tanous        'circular_buffer',
267f80a87f2SEd Tanous        'callable_traits',
268f80a87f2SEd Tanous        'headers',
269f80a87f2SEd Tanous        'process',
270f80a87f2SEd Tanous        'type_index',
271f80a87f2SEd Tanous        'url',
272f80a87f2SEd Tanous        'uuid',
273f80a87f2SEd Tanous        'spirit',
274f80a87f2SEd Tanous    ]
275f2caadceSEd Tanous    opt.add_cmake_defines(
276f2caadceSEd Tanous        {
277*4ed30a8bSEd Tanous            # 1.86.0 fails this.  Hopefully fixed in 1.86.1
278*4ed30a8bSEd Tanous            'CMAKE_CXX_FLAGS': '-Wno-unused-parameter',
279f80a87f2SEd Tanous            'BOOST_INCLUDE_LIBRARIES': ';'.join(boost_libs),
280144983c5SEd Tanous            'BUILD_SHARED_LIBS': 'OFF',
281f2caadceSEd Tanous        },
282f2caadceSEd Tanous    )
283144983c5SEd Tanous
2846fd29553SEd Tanous    boost = cmake.subproject('boost', required: true, options: opt)
285f80a87f2SEd Tanous    foreach boost_lib : boost_libs
286f80a87f2SEd Tanous        boost_lib_instance = boost.dependency('boost_' + boost_lib).as_system()
287f80a87f2SEd Tanous        bmcweb_dependencies += [boost_lib_instance]
288f80a87f2SEd Tanous    endforeach
289af6298daSManojkiran Edaendif
290af6298daSManojkiran Eda
291549bed29SPatrick Williamsif get_option('tests').allowed()
292f2caadceSEd Tanous    gtest = dependency(
293f2caadceSEd Tanous        'gtest',
294f2caadceSEd Tanous        main: true,
295f2caadceSEd Tanous        version: '>=1.14.0',
296f2caadceSEd Tanous        disabler: true,
297f2caadceSEd Tanous        required: false,
298f2caadceSEd Tanous    )
299af6298daSManojkiran Eda    gmock = dependency('gmock', required: false)
300549bed29SPatrick Williams    if not gtest.found() and get_option('tests').allowed()
301af6298daSManojkiran Eda        gtest_proj = subproject('gtest', required: true)
302af6298daSManojkiran Eda        gtest = gtest_proj.get_variable('gtest_main_dep')
303af6298daSManojkiran Eda        gmock = gtest_proj.get_variable('gmock_dep')
304af6298daSManojkiran Eda    endif
305b00dcc27SEd Tanous    gtest = gtest.as_system('system')
306b00dcc27SEd Tanous    gmock = gmock.as_system('system')
307af6298daSManojkiran Edaendif
308af6298daSManojkiran Eda
3094efe3e0cSPatrick Williamssystemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
310af6298daSManojkiran Eda
311af6298daSManojkiran Edabindir = get_option('prefix') + '/' + get_option('bindir')
312af6298daSManojkiran Eda
313f2caadceSEd Tanoussummary(
314f2caadceSEd Tanous    {
315af6298daSManojkiran Eda        'prefix': get_option('prefix'),
316af6298daSManojkiran Eda        'bindir': bindir,
317f2caadceSEd Tanous        'systemd unit directory': systemd_system_unit_dir,
318f2caadceSEd Tanous    },
319f2caadceSEd Tanous    section: 'Directories',
320f2caadceSEd Tanous)
321af6298daSManojkiran Eda
322a529a6aaSEd Tanoussubdir('static')
323a529a6aaSEd Tanoussubdir('redfish-core')
324af6298daSManojkiran Eda
325307386e8SNan Zhou# Config subdirectory
326307386e8SNan Zhousubdir('config')
327307386e8SNan Zhoubmcweb_dependencies += conf_h_dep
328307386e8SNan Zhou
32902f1cd9bSEd Tanous# Source files
3300ad63df8SNan Zhoufs = import('fs')
331af6298daSManojkiran Eda
3320ad63df8SNan Zhousrcfiles_bmcweb = files(
333724985ffSEd Tanous    'http/mutual_tls.cpp',
33402f1cd9bSEd Tanous    'redfish-core/src/error_messages.cpp',
33525991f7dSEd Tanous    'redfish-core/src/filter_expr_executor.cpp',
336f88b2170SEd Tanous    'redfish-core/src/filter_expr_printer.cpp',
337f2caadceSEd Tanous    'redfish-core/src/redfish.cpp',
338d1d411f9SSui Chen    'redfish-core/src/registries.cpp',
339d02aad39SEd Tanous    'redfish-core/src/utils/dbus_utils.cpp',
34002f1cd9bSEd Tanous    'redfish-core/src/utils/json_utils.cpp',
3413cd7072bSEd Tanous    'redfish-core/src/utils/time_utils.cpp',
342f523c324SEd Tanous    'src/boost_asio.cpp',
343f2caadceSEd Tanous    'src/boost_asio_ssl.cpp',
344f523c324SEd Tanous    'src/boost_beast.cpp',
3456384e323SNan Zhou    'src/dbus_singleton.cpp',
34661e349acSEd Tanous    'src/json_html_serializer.cpp',
3472c6ffdb0SEd Tanous    'src/ossl_random.cpp',
348724985ffSEd Tanous    'src/ssl_key_handler.cpp',
349f2caadceSEd Tanous    'src/webserver_run.cpp',
3500ad63df8SNan Zhou)
35102f1cd9bSEd Tanous
35242bbcd87SEd Tanousbmcweblib = static_library(
35342bbcd87SEd Tanous    'bmcweblib',
35442bbcd87SEd Tanous    srcfiles_bmcweb,
35542bbcd87SEd Tanous    include_directories: incdir,
35642bbcd87SEd Tanous    dependencies: bmcweb_dependencies,
35742bbcd87SEd Tanous)
35842bbcd87SEd Tanous
35902f1cd9bSEd Tanous# Generate the bmcweb executable
36002f1cd9bSEd Tanousexecutable(
36102f1cd9bSEd Tanous    'bmcweb',
36242bbcd87SEd Tanous    'src/webserver_main.cpp',
363af6298daSManojkiran Eda    include_directories: incdir,
364ceb8ddc1SJason M. Bills    dependencies: bmcweb_dependencies,
36542bbcd87SEd Tanous    link_with: bmcweblib,
3665e34b67aSEd Tanous    link_args: '-Wl,--gc-sections',
367af6298daSManojkiran Eda    install: true,
368f2caadceSEd Tanous    install_dir: bindir,
36902f1cd9bSEd Tanous)
37002f1cd9bSEd Tanous
3710ad63df8SNan Zhousrcfiles_unittest = files(
372c33a039bSNan Zhou    'test/http/crow_getroutes_test.cpp',
37352dd6932SEd Tanous    'test/http/http2_connection_test.cpp',
374f2caadceSEd Tanous    'test/http/http_body_test.cpp',
3754fa45dffSEd Tanous    'test/http/http_connection_test.cpp',
3768e3f7032SAbhilash Raju    'test/http/http_response_test.cpp',
377f2caadceSEd Tanous    'test/http/mutual_tls.cpp',
378f2caadceSEd Tanous    'test/http/mutual_tls_meta.cpp',
379f2caadceSEd Tanous    'test/http/parsing_test.cpp',
380f2caadceSEd Tanous    'test/http/router_test.cpp',
381f2caadceSEd Tanous    'test/http/server_sent_event_test.cpp',
382c33a039bSNan Zhou    'test/http/utility_test.cpp',
3832c9efc3cSEd Tanous    'test/http/verb_test.cpp',
384e1452beaSEd Tanous    'test/include/async_resolve_test.cpp',
38511e8f60dSEd Tanous    'test/include/credential_pipe_test.cpp',
386f2caadceSEd Tanous    'test/include/dbus_utility_test.cpp',
387f2caadceSEd Tanous    'test/include/google/google_service_root_test.cpp',
388f2caadceSEd Tanous    'test/include/http_utility_test.cpp',
389f2caadceSEd Tanous    'test/include/human_sort_test.cpp',
390c33a039bSNan Zhou    'test/include/ibm/configfile_test.cpp',
391f2caadceSEd Tanous    'test/include/json_html_serializer.cpp',
392c33a039bSNan Zhou    'test/include/multipart_test.cpp',
393c33a039bSNan Zhou    'test/include/openbmc_dbus_rest_test.cpp',
3942c6ffdb0SEd Tanous    'test/include/ossl_random.cpp',
395099225ccSEd Tanous    'test/include/ssl_key_handler_test.cpp',
396f2caadceSEd Tanous    'test/include/str_utility_test.cpp',
397c33a039bSNan Zhou    'test/redfish-core/include/privileges_test.cpp',
39825991f7dSEd Tanous    'test/redfish-core/include/filter_expr_executor_test.cpp',
399f88b2170SEd Tanous    'test/redfish-core/include/filter_expr_parser_test.cpp',
4007e8890c5SCarson Labrado    'test/redfish-core/include/redfish_aggregator_test.cpp',
401c33a039bSNan Zhou    'test/redfish-core/include/registries_test.cpp',
402d02aad39SEd Tanous    'test/redfish-core/include/utils/dbus_utils.cpp',
403f2caadceSEd Tanous    'test/redfish-core/include/utils/hex_utils_test.cpp',
404c33a039bSNan Zhou    'test/redfish-core/include/utils/ip_utils_test.cpp',
405c33a039bSNan Zhou    'test/redfish-core/include/utils/json_utils_test.cpp',
406c33a039bSNan Zhou    'test/redfish-core/include/utils/query_param_test.cpp',
4071516c21bSJanet Adkins    'test/redfish-core/include/utils/sensor_utils_test.cpp',
408c33a039bSNan Zhou    'test/redfish-core/include/utils/stl_utils_test.cpp',
409c33a039bSNan Zhou    'test/redfish-core/include/utils/time_utils_test.cpp',
410c33a039bSNan Zhou    'test/redfish-core/lib/chassis_test.cpp',
411c33a039bSNan Zhou    'test/redfish-core/lib/log_services_dump_test.cpp',
41275e8e218SMyung Bae    'test/redfish-core/lib/log_services_test.cpp',
413e610b316SJagpal Singh Gill    'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
414090ab8e1SEd Tanous    'test/redfish-core/lib/metadata_test.cpp',
415f2caadceSEd Tanous    'test/redfish-core/lib/power_subsystem_test.cpp',
416f2caadceSEd Tanous    'test/redfish-core/lib/service_root_test.cpp',
417f2caadceSEd Tanous    'test/redfish-core/lib/system_test.cpp',
418f2caadceSEd Tanous    'test/redfish-core/lib/thermal_subsystem_test.cpp',
419f2caadceSEd Tanous    'test/redfish-core/lib/update_service_test.cpp',
4200ad63df8SNan Zhou)
421af6298daSManojkiran Eda
422549bed29SPatrick Williamsif (get_option('tests').allowed())
42302f1cd9bSEd Tanous    # generate the test executable
4240ad63df8SNan Zhou    foreach test_src : srcfiles_unittest
4250ad63df8SNan Zhou        test_bin = executable(
4260ad63df8SNan Zhou            fs.stem(test_src),
42742bbcd87SEd Tanous            test_src,
42842bbcd87SEd Tanous            link_with: bmcweblib,
429af6298daSManojkiran Eda            include_directories: incdir,
430af6298daSManojkiran Eda            install_dir: bindir,
431f2caadceSEd Tanous            dependencies: bmcweb_dependencies
432f2caadceSEd Tanous            + [
433cf2f932eSEd Tanous                gtest,
434cf2f932eSEd Tanous                gmock,
435f2caadceSEd Tanous            ],
43602f1cd9bSEd Tanous        )
4370ad63df8SNan Zhou        test(fs.stem(test_src), test_bin)
4380ad63df8SNan Zhou    endforeach
439af6298daSManojkiran Edaendif
440