xref: /openbmc/bmcweb/meson.build (revision 8dc3ddf60186e4f50a657efa258cde880a240b09)
1f2caadceSEd Tanousproject(
2f2caadceSEd Tanous    'bmcweb',
3f2caadceSEd Tanous    'cpp',
4af6298daSManojkiran Eda    version: '1.0',
5*8dc3ddf6SEd 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',
13f523c324SEd Tanous        'cpp_std=c++20',
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
28c52ee72bSPatrick Williamsif get_option('cpp_std') != 'c++20'
29c52ee72bSPatrick Williams    error('This project requires c++20 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',
75f523c324SEd Tanous        '-Wno-documentation-unknown-command',
76f523c324SEd Tanous        '-Wno-documentation',
77af6298daSManojkiran Eda        '-Wno-exit-time-destructors',
78f523c324SEd Tanous        '-Wno-global-constructors',
79f523c324SEd Tanous        '-Wno-newline-eof',
80f523c324SEd Tanous        '-Wno-padded',
81af6298daSManojkiran Eda        '-Wno-shadow',
82af6298daSManojkiran Eda        '-Wno-used-but-marked-unused',
83af6298daSManojkiran Eda        '-Wno-weak-vtables',
84e6801eb4SEd Tanous        '-Wno-switch-enum',
8572b90760SEd Tanous        '-Wno-unused-macros',
864da0490bSEd Tanous        '-Wno-covered-switch-default',
87f2caadceSEd Tanous        language: 'cpp',
88f2caadceSEd Tanous    )
89af6298daSManojkiran Edaendif
90af6298daSManojkiran Eda
91ade3f093SEd Tanousif (cxx.get_id() == 'gcc')
92ade3f093SEd Tanous    if (cxx.version().version_compare('<13.0'))
93ade3f093SEd Tanous        error('This project requires gcc-13 or higher')
94ade3f093SEd Tanous    endif
95af6298daSManojkiran Eda
96af6298daSManojkiran Eda    add_project_arguments(
97ade3f093SEd Tanous        '-Wformat=2',
98ade3f093SEd Tanous        '-Wcast-align',
99ade3f093SEd Tanous        '-Wconversion',
100ade3f093SEd Tanous        '-Woverloaded-virtual',
101ade3f093SEd Tanous        '-Wsign-conversion',
102ade3f093SEd Tanous        '-Wunused',
103af6298daSManojkiran Eda        '-Wduplicated-cond',
104af6298daSManojkiran Eda        '-Wduplicated-branches',
105af6298daSManojkiran Eda        '-Wlogical-op',
106af6298daSManojkiran Eda        '-Wnull-dereference',
107079360aeSEd Tanous        '-Wunused-parameter',
108af6298daSManojkiran Eda        '-Wdouble-promotion',
1098a592810SEd Tanous        '-Wshadow',
11030f11eb4SEd Tanous        '-Wno-psabi',
111ade3f093SEd Tanous        '-Wno-attributes',
112f2caadceSEd Tanous        language: 'cpp',
113f2caadceSEd Tanous    )
114c66403c3SEd Tanousendif
115af6298daSManojkiran Eda
116af6298daSManojkiran Edaif (get_option('buildtype') != 'plain')
117af6298daSManojkiran Eda    if (get_option('b_lto') == true and get_option('optimization') != '0')
118af6298daSManojkiran Eda        # Reduce the binary size by removing unnecessary
119af6298daSManojkiran Eda        # dynamic symbol table entries
120af6298daSManojkiran Eda
121af6298daSManojkiran Eda        add_project_arguments(
122f2caadceSEd Tanous            cxx.get_supported_arguments(
123f2caadceSEd Tanous                [
124af6298daSManojkiran Eda                    '-fno-fat-lto-objects',
125af6298daSManojkiran Eda                    '-fvisibility=hidden',
126f2caadceSEd Tanous                    '-fvisibility-inlines-hidden',
127f2caadceSEd Tanous                ],
128f2caadceSEd Tanous            ),
129f2caadceSEd Tanous            language: 'cpp',
130f2caadceSEd Tanous        )
131af6298daSManojkiran Eda
132af6298daSManojkiran Eda        if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
133af6298daSManojkiran Eda            add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
134af6298daSManojkiran Eda        endif
135af6298daSManojkiran Eda    endif
136c66403c3SEd Tanousendif
137af6298daSManojkiran Eda# Set Compiler Security flags
138af6298daSManojkiran Eda
139af6298daSManojkiran Edasecurity_flags = [
140af6298daSManojkiran Eda    '-fstack-protector-strong',
141af6298daSManojkiran Eda    '-fPIE',
142af6298daSManojkiran Eda    '-fPIC',
143af6298daSManojkiran Eda    '-D_FORTIFY_SOURCE=2',
144af6298daSManojkiran Eda    '-Wformat',
145f2caadceSEd Tanous    '-Wformat-security',
146af6298daSManojkiran Eda]
147af6298daSManojkiran Eda
148af6298daSManojkiran Eda## Add security flags for builds of type 'release','debugoptimized' and 'minsize'
149af6298daSManojkiran Eda
150f2caadceSEd Tanousif not (
151f2caadceSEd Tanous    get_option('buildtype') == 'plain'
152f2caadceSEd Tanous    or get_option('buildtype').startswith('debug')
153f2caadceSEd Tanous)
154f2caadceSEd Tanous    add_project_arguments(cxx.get_supported_arguments([security_flags]), language: 'cpp')
155af6298daSManojkiran Edaendif
156af6298daSManojkiran Eda
157af6298daSManojkiran Eda# Boost dependency configuration
158af6298daSManojkiran Eda
159af6298daSManojkiran Edaadd_project_arguments(
160f2caadceSEd Tanous    cxx.get_supported_arguments(
161f2caadceSEd Tanous        [
1626fd29553SEd Tanous            '-DBOOST_ASIO_DISABLE_CONCEPTS',
163af6298daSManojkiran Eda            '-DBOOST_ALL_NO_LIB',
16458e42b18SEd Tanous            '-DBOOST_ALLOW_DEPRECATED_HEADERS',
165f523c324SEd Tanous            '-DBOOST_ASIO_DISABLE_THREADS',
166f523c324SEd Tanous            '-DBOOST_ASIO_NO_DEPRECATED',
167f523c324SEd Tanous            '-DBOOST_ASIO_SEPARATE_COMPILATION',
168f523c324SEd Tanous            '-DBOOST_BEAST_SEPARATE_COMPILATION',
1699e710e7fSEd Tanous            '-DBOOST_EXCEPTION_DISABLE',
170f706551dSEd Tanous            '-DBOOST_NO_EXCEPTIONS',
171ab6b6fecSEd Tanous            '-DBOOST_URL_NO_SOURCE_LOCATION',
1729e710e7fSEd Tanous            '-DJSON_NOEXCEPTION',
173209aa909SEd Tanous            '-DOPENSSL_NO_FILENAMES',
174f706551dSEd Tanous            '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES',
175f2caadceSEd Tanous        ],
176f2caadceSEd Tanous    ),
177f2caadceSEd Tanous    language: 'cpp',
178f2caadceSEd Tanous)
179af6298daSManojkiran Eda
180af6298daSManojkiran Eda# Find the dependency modules, if not found use meson wrap to get them
181af6298daSManojkiran Eda# automatically during the configure step
182ceb8ddc1SJason M. Billsbmcweb_dependencies = []
183af6298daSManojkiran Eda
1848682c5adSNan Zhoupam = cxx.find_library('pam', required: true)
185af6298daSManojkiran Edaatomic = cxx.find_library('atomic', required: true)
186e7923997SEd Tanousbmcweb_dependencies += [pam, atomic]
187e7923997SEd Tanous
188e7923997SEd Tanousopenssl = dependency('openssl', required: false, version: '>=3.0.0')
189e7923997SEd Tanousif not openssl.found() or get_option('b_sanitize') != 'none'
190e7923997SEd Tanous    openssl_proj = subproject(
191e7923997SEd Tanous        'openssl',
192e7923997SEd Tanous        required: true,
193f2caadceSEd Tanous        default_options: ['warning_level=0', 'werror=false'],
194e7923997SEd Tanous    )
195e7923997SEd Tanous    openssl = openssl_proj.get_variable('openssl_dep')
196e7923997SEd Tanous    openssl = openssl.as_system('system')
197e7923997SEd Tanousendif
198e7923997SEd Tanousbmcweb_dependencies += [openssl]
199af6298daSManojkiran Eda
200fca2cbeaSEd Tanousnghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false)
201fca2cbeaSEd Tanousif not nghttp2.found()
202fca2cbeaSEd Tanous    cmake = import('cmake')
203fca2cbeaSEd Tanous    opt_var = cmake.subproject_options()
204211cfa49SEd Tanous    opt_var.add_cmake_defines(
205211cfa49SEd Tanous        {
206211cfa49SEd Tanous            'ENABLE_LIB_ONLY': true,
207211cfa49SEd Tanous            'ENABLE_STATIC_LIB': true,
208211cfa49SEd Tanous        },
209211cfa49SEd Tanous    )
210fca2cbeaSEd Tanous    nghttp2_ex = cmake.subproject('nghttp2', options: opt_var)
211211cfa49SEd Tanous    nghttp2 = nghttp2_ex.dependency('nghttp2')
212fca2cbeaSEd Tanousendif
213fca2cbeaSEd Tanousbmcweb_dependencies += nghttp2
214fca2cbeaSEd Tanous
2157bb985eeSEd Tanoussdbusplus = dependency('sdbusplus', required: false, include_type: 'system')
216af6298daSManojkiran Edaif not sdbusplus.found()
217af6298daSManojkiran Eda    sdbusplus_proj = subproject('sdbusplus', required: true)
218af6298daSManojkiran Eda    sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
219af6298daSManojkiran Eda    sdbusplus = sdbusplus.as_system('system')
220af6298daSManojkiran Edaendif
221ceb8ddc1SJason M. Billsbmcweb_dependencies += sdbusplus
222af6298daSManojkiran Eda
223c9374ff6SEd Tanoustinyxml = dependency(
224c9374ff6SEd Tanous    'tinyxml2',
225565c0911SPatrick Williams    include_type: 'system',
226c9374ff6SEd Tanous    version: '>=9.0.0',
22760e299bdSKonstantin Aladyshev    default_options: ['tests=false'],
228565c0911SPatrick Williams)
229c9374ff6SEd Tanousif not tinyxml.found()
230c9374ff6SEd Tanous    tinyxml_proj = subproject('tinyxml2', required: true)
231c9374ff6SEd Tanous    tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
232c9374ff6SEd Tanous    tinyxml = tinyxml.as_system('system')
233c9374ff6SEd Tanousendif
234ceb8ddc1SJason M. Billsbmcweb_dependencies += tinyxml
235af6298daSManojkiran Eda
236af6298daSManojkiran Edasystemd = dependency('systemd')
237af6298daSManojkiran Edazlib = dependency('zlib')
238ceb8ddc1SJason M. Billsbmcweb_dependencies += [systemd, zlib]
239af6298daSManojkiran Eda
240dfd5547bSPatrick Williamsnlohmann_json_dep = dependency('nlohmann_json', version: '>=3.11.2', include_type: 'system')
241dfd5547bSPatrick Williamsbmcweb_dependencies += nlohmann_json_dep
242af6298daSManojkiran Eda
2432b5b4daeSCarson Labradoboost = dependency(
2442b5b4daeSCarson Labrado    'boost',
2452b5b4daeSCarson Labrado    modules: [
2462b5b4daeSCarson Labrado        'url',
2472b5b4daeSCarson Labrado    ],
248619b8609SEd Tanous    version: '>=1.84.0',
2492b5b4daeSCarson Labrado    required: false,
250f2caadceSEd Tanous    include_type: 'system',
2512b5b4daeSCarson Labrado)
2526fd29553SEd Tanousif boost.found()
2536fd29553SEd Tanous    bmcweb_dependencies += [boost]
2546fd29553SEd Tanouselse
2556fd29553SEd Tanous    cmake = import('cmake')
2566fd29553SEd Tanous    opt = cmake.subproject_options()
257f2caadceSEd Tanous    opt.add_cmake_defines(
258f2caadceSEd Tanous        {
259144983c5SEd Tanous            'BOOST_INCLUDE_LIBRARIES': 'asio;beast;callable_traits;headers;process;type_index;url;uuid',
260144983c5SEd Tanous            'BUILD_SHARED_LIBS': 'OFF',
261f2caadceSEd Tanous        },
262f2caadceSEd Tanous    )
263144983c5SEd Tanous
2646fd29553SEd Tanous    boost = cmake.subproject('boost', required: true, options: opt)
2652b5b4daeSCarson Labrado    boost_asio = boost.dependency('boost_asio').as_system()
2662b5b4daeSCarson Labrado    boost_beast = boost.dependency('boost_beast').as_system()
2672b5b4daeSCarson Labrado    boost_callable_traits = boost.dependency('boost_callable_traits').as_system()
2686fd29553SEd Tanous    boost_headers = boost.dependency('boost_headers').as_system()
2692b5b4daeSCarson Labrado    boost_process = boost.dependency('boost_process').as_system()
2702b5b4daeSCarson Labrado    boost_type_index = boost.dependency('boost_type_index').as_system()
2712b5b4daeSCarson Labrado    boost_url = boost.dependency('boost_url').as_system()
2722b5b4daeSCarson Labrado    boost_uuid = boost.dependency('boost_uuid').as_system()
2732b5b4daeSCarson Labrado    bmcweb_dependencies += [
2742b5b4daeSCarson Labrado        boost_asio,
2752b5b4daeSCarson Labrado        boost_beast,
2762b5b4daeSCarson Labrado        boost_callable_traits,
2772b5b4daeSCarson Labrado        boost_headers,
2782b5b4daeSCarson Labrado        boost_process,
2792b5b4daeSCarson Labrado        boost_type_index,
2802b5b4daeSCarson Labrado        boost_url,
281f2caadceSEd Tanous        boost_uuid,
2822b5b4daeSCarson Labrado    ]
283af6298daSManojkiran Edaendif
284af6298daSManojkiran Eda
285549bed29SPatrick Williamsif get_option('tests').allowed()
286f2caadceSEd Tanous    gtest = dependency(
287f2caadceSEd Tanous        'gtest',
288f2caadceSEd Tanous        main: true,
289f2caadceSEd Tanous        version: '>=1.14.0',
290f2caadceSEd Tanous        disabler: true,
291f2caadceSEd Tanous        required: false,
292f2caadceSEd Tanous    )
293af6298daSManojkiran Eda    gmock = dependency('gmock', required: false)
294549bed29SPatrick Williams    if not gtest.found() and get_option('tests').allowed()
295af6298daSManojkiran Eda        gtest_proj = subproject('gtest', required: true)
296af6298daSManojkiran Eda        gtest = gtest_proj.get_variable('gtest_main_dep')
297af6298daSManojkiran Eda        gmock = gtest_proj.get_variable('gmock_dep')
298af6298daSManojkiran Eda    endif
299b00dcc27SEd Tanous    gtest = gtest.as_system('system')
300b00dcc27SEd Tanous    gmock = gmock.as_system('system')
301af6298daSManojkiran Edaendif
302af6298daSManojkiran Eda
3034efe3e0cSPatrick Williamssystemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
304af6298daSManojkiran Eda
305af6298daSManojkiran Edabindir = get_option('prefix') + '/' + get_option('bindir')
306af6298daSManojkiran Eda
307f2caadceSEd Tanoussummary(
308f2caadceSEd Tanous    {
309af6298daSManojkiran Eda        'prefix': get_option('prefix'),
310af6298daSManojkiran Eda        'bindir': bindir,
311f2caadceSEd Tanous        'systemd unit directory': systemd_system_unit_dir,
312f2caadceSEd Tanous    },
313f2caadceSEd Tanous    section: 'Directories',
314f2caadceSEd Tanous)
315af6298daSManojkiran Eda
3161fc21359SEd Tanousinstall_subdir('static', install_dir: 'share/www', strip_directory: true, follow_symlinks: true)
317af6298daSManojkiran Eda
318307386e8SNan Zhou# Config subdirectory
319307386e8SNan Zhou
320307386e8SNan Zhousubdir('config')
321307386e8SNan Zhoubmcweb_dependencies += conf_h_dep
322307386e8SNan Zhou
32302f1cd9bSEd Tanous# Source files
3240ad63df8SNan Zhoufs = import('fs')
325af6298daSManojkiran Eda
3260ad63df8SNan Zhousrcfiles_bmcweb = files(
3273cd7072bSEd Tanous    # end large files
3283cd7072bSEd Tanous
32902f1cd9bSEd Tanous    'redfish-core/src/error_messages.cpp',
330f2caadceSEd Tanous    # Begin large files, should be at the beginning
331f2caadceSEd Tanous    'redfish-core/src/redfish.cpp',
332d1d411f9SSui Chen    'redfish-core/src/registries.cpp',
333d02aad39SEd Tanous    'redfish-core/src/utils/dbus_utils.cpp',
33402f1cd9bSEd Tanous    'redfish-core/src/utils/json_utils.cpp',
3353cd7072bSEd Tanous    'redfish-core/src/utils/time_utils.cpp',
336f523c324SEd Tanous    'src/boost_asio.cpp',
337f2caadceSEd Tanous    'src/boost_asio_ssl.cpp',
338f523c324SEd Tanous    'src/boost_beast.cpp',
3396384e323SNan Zhou    'src/dbus_singleton.cpp',
34061e349acSEd Tanous    'src/json_html_serializer.cpp',
3412c6ffdb0SEd Tanous    'src/ossl_random.cpp',
342f2caadceSEd Tanous    'src/webserver_run.cpp',
3430ad63df8SNan Zhou)
34402f1cd9bSEd Tanous
34542bbcd87SEd Tanousbmcweblib = static_library(
34642bbcd87SEd Tanous    'bmcweblib',
34742bbcd87SEd Tanous    srcfiles_bmcweb,
34842bbcd87SEd Tanous    include_directories: incdir,
34942bbcd87SEd Tanous    dependencies: bmcweb_dependencies,
35042bbcd87SEd Tanous)
35142bbcd87SEd Tanous
35202f1cd9bSEd Tanous# Generate the bmcweb executable
35302f1cd9bSEd Tanousexecutable(
35402f1cd9bSEd Tanous    'bmcweb',
35542bbcd87SEd Tanous    'src/webserver_main.cpp',
356af6298daSManojkiran Eda    include_directories: incdir,
357ceb8ddc1SJason M. Bills    dependencies: bmcweb_dependencies,
35842bbcd87SEd Tanous    link_with: bmcweblib,
3595e34b67aSEd Tanous    link_args: '-Wl,--gc-sections',
360af6298daSManojkiran Eda    install: true,
361f2caadceSEd Tanous    install_dir: bindir,
36202f1cd9bSEd Tanous)
36302f1cd9bSEd Tanous
3640ad63df8SNan Zhousrcfiles_unittest = files(
365c33a039bSNan Zhou    'test/http/crow_getroutes_test.cpp',
36652dd6932SEd Tanous    'test/http/http2_connection_test.cpp',
367f2caadceSEd Tanous    'test/http/http_body_test.cpp',
3684fa45dffSEd Tanous    'test/http/http_connection_test.cpp',
3698e3f7032SAbhilash Raju    'test/http/http_response_test.cpp',
370f2caadceSEd Tanous    'test/http/mutual_tls.cpp',
371f2caadceSEd Tanous    'test/http/mutual_tls_meta.cpp',
372f2caadceSEd Tanous    'test/http/parsing_test.cpp',
373f2caadceSEd Tanous    'test/http/router_test.cpp',
374f2caadceSEd Tanous    'test/http/server_sent_event_test.cpp',
375c33a039bSNan Zhou    'test/http/utility_test.cpp',
3762c9efc3cSEd Tanous    'test/http/verb_test.cpp',
377e1452beaSEd Tanous    'test/include/async_resolve_test.cpp',
37811e8f60dSEd Tanous    'test/include/credential_pipe_test.cpp',
379f2caadceSEd Tanous    'test/include/dbus_utility_test.cpp',
380f2caadceSEd Tanous    'test/include/google/google_service_root_test.cpp',
381f2caadceSEd Tanous    'test/include/http_utility_test.cpp',
382f2caadceSEd Tanous    'test/include/human_sort_test.cpp',
383c33a039bSNan Zhou    'test/include/ibm/configfile_test.cpp',
384f2caadceSEd Tanous    'test/include/json_html_serializer.cpp',
385c33a039bSNan Zhou    'test/include/multipart_test.cpp',
386c33a039bSNan Zhou    'test/include/openbmc_dbus_rest_test.cpp',
3872c6ffdb0SEd Tanous    'test/include/ossl_random.cpp',
388099225ccSEd Tanous    'test/include/ssl_key_handler_test.cpp',
389f2caadceSEd Tanous    'test/include/str_utility_test.cpp',
390c33a039bSNan Zhou    'test/redfish-core/include/privileges_test.cpp',
3917e8890c5SCarson Labrado    'test/redfish-core/include/redfish_aggregator_test.cpp',
392c33a039bSNan Zhou    'test/redfish-core/include/registries_test.cpp',
393d02aad39SEd Tanous    'test/redfish-core/include/utils/dbus_utils.cpp',
394f2caadceSEd Tanous    'test/redfish-core/include/utils/hex_utils_test.cpp',
395c33a039bSNan Zhou    'test/redfish-core/include/utils/ip_utils_test.cpp',
396c33a039bSNan Zhou    'test/redfish-core/include/utils/json_utils_test.cpp',
397c33a039bSNan Zhou    'test/redfish-core/include/utils/query_param_test.cpp',
398c33a039bSNan Zhou    'test/redfish-core/include/utils/stl_utils_test.cpp',
399c33a039bSNan Zhou    'test/redfish-core/include/utils/time_utils_test.cpp',
400c33a039bSNan Zhou    'test/redfish-core/lib/chassis_test.cpp',
401c33a039bSNan Zhou    'test/redfish-core/lib/log_services_dump_test.cpp',
40275e8e218SMyung Bae    'test/redfish-core/lib/log_services_test.cpp',
403e610b316SJagpal Singh Gill    'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
404090ab8e1SEd Tanous    'test/redfish-core/lib/metadata_test.cpp',
405f2caadceSEd Tanous    'test/redfish-core/lib/power_subsystem_test.cpp',
406f2caadceSEd Tanous    'test/redfish-core/lib/sensors_test.cpp',
407f2caadceSEd Tanous    'test/redfish-core/lib/service_root_test.cpp',
408f2caadceSEd Tanous    'test/redfish-core/lib/system_test.cpp',
409f2caadceSEd Tanous    'test/redfish-core/lib/thermal_subsystem_test.cpp',
410f2caadceSEd Tanous    'test/redfish-core/lib/update_service_test.cpp',
4110ad63df8SNan Zhou)
412af6298daSManojkiran Eda
413549bed29SPatrick Williamsif (get_option('tests').allowed())
41402f1cd9bSEd Tanous    # generate the test executable
4150ad63df8SNan Zhou    foreach test_src : srcfiles_unittest
4160ad63df8SNan Zhou        test_bin = executable(
4170ad63df8SNan Zhou            fs.stem(test_src),
41842bbcd87SEd Tanous            test_src,
41942bbcd87SEd Tanous            link_with: bmcweblib,
420af6298daSManojkiran Eda            include_directories: incdir,
421af6298daSManojkiran Eda            install_dir: bindir,
422f2caadceSEd Tanous            dependencies: bmcweb_dependencies
423f2caadceSEd Tanous            + [
424cf2f932eSEd Tanous                gtest,
425cf2f932eSEd Tanous                gmock,
426f2caadceSEd Tanous            ],
42702f1cd9bSEd Tanous        )
4280ad63df8SNan Zhou        test(fs.stem(test_src), test_bin)
4290ad63df8SNan Zhou    endforeach
430af6298daSManojkiran Edaendif
431