xref: /openbmc/bmcweb/meson.build (revision 25991f7dd01e7b36b6691a2c8a37bda5c933ba84)
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',
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',
75*25991f7dSEd 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',
89f2caadceSEd Tanous        language: 'cpp',
90f2caadceSEd Tanous    )
91af6298daSManojkiran Edaendif
92af6298daSManojkiran Eda
93ade3f093SEd Tanousif (cxx.get_id() == 'gcc')
94ade3f093SEd Tanous    if (cxx.version().version_compare('<13.0'))
95ade3f093SEd Tanous        error('This project requires gcc-13 or higher')
96ade3f093SEd Tanous    endif
97af6298daSManojkiran Eda
98af6298daSManojkiran Eda    add_project_arguments(
99ade3f093SEd Tanous        '-Wformat=2',
100ade3f093SEd Tanous        '-Wcast-align',
101ade3f093SEd Tanous        '-Wconversion',
102ade3f093SEd Tanous        '-Woverloaded-virtual',
103ade3f093SEd Tanous        '-Wsign-conversion',
104ade3f093SEd Tanous        '-Wunused',
105af6298daSManojkiran Eda        '-Wduplicated-cond',
106af6298daSManojkiran Eda        '-Wduplicated-branches',
107af6298daSManojkiran Eda        '-Wlogical-op',
108af6298daSManojkiran Eda        '-Wnull-dereference',
109079360aeSEd Tanous        '-Wunused-parameter',
110af6298daSManojkiran Eda        '-Wdouble-promotion',
1118a592810SEd Tanous        '-Wshadow',
11230f11eb4SEd Tanous        '-Wno-psabi',
113ade3f093SEd Tanous        '-Wno-attributes',
114f2caadceSEd Tanous        language: 'cpp',
115f2caadceSEd Tanous    )
116c66403c3SEd Tanousendif
117af6298daSManojkiran Eda
118af6298daSManojkiran Edaif (get_option('buildtype') != 'plain')
119af6298daSManojkiran Eda    if (get_option('b_lto') == true and get_option('optimization') != '0')
120af6298daSManojkiran Eda        # Reduce the binary size by removing unnecessary
121af6298daSManojkiran Eda        # dynamic symbol table entries
122af6298daSManojkiran Eda
123af6298daSManojkiran Eda        add_project_arguments(
124f2caadceSEd Tanous            cxx.get_supported_arguments(
125f2caadceSEd Tanous                [
126af6298daSManojkiran Eda                    '-fno-fat-lto-objects',
127af6298daSManojkiran Eda                    '-fvisibility=hidden',
128f2caadceSEd Tanous                    '-fvisibility-inlines-hidden',
129f2caadceSEd Tanous                ],
130f2caadceSEd Tanous            ),
131f2caadceSEd Tanous            language: 'cpp',
132f2caadceSEd Tanous        )
133af6298daSManojkiran Eda
134af6298daSManojkiran Eda        if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
135af6298daSManojkiran Eda            add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
136af6298daSManojkiran Eda        endif
137af6298daSManojkiran Eda    endif
138c66403c3SEd Tanousendif
139af6298daSManojkiran Eda# Set Compiler Security flags
140af6298daSManojkiran Eda
141af6298daSManojkiran Edasecurity_flags = [
142af6298daSManojkiran Eda    '-fstack-protector-strong',
143af6298daSManojkiran Eda    '-fPIE',
144af6298daSManojkiran Eda    '-fPIC',
145af6298daSManojkiran Eda    '-D_FORTIFY_SOURCE=2',
146af6298daSManojkiran Eda    '-Wformat',
147f2caadceSEd Tanous    '-Wformat-security',
148af6298daSManojkiran Eda]
149af6298daSManojkiran Eda
150af6298daSManojkiran Eda## Add security flags for builds of type 'release','debugoptimized' and 'minsize'
151af6298daSManojkiran Eda
152f2caadceSEd Tanousif not (
153f2caadceSEd Tanous    get_option('buildtype') == 'plain'
154f2caadceSEd Tanous    or get_option('buildtype').startswith('debug')
155f2caadceSEd Tanous)
156f2caadceSEd Tanous    add_project_arguments(cxx.get_supported_arguments([security_flags]), language: 'cpp')
157af6298daSManojkiran Edaendif
158af6298daSManojkiran Eda
159af6298daSManojkiran Eda# Boost dependency configuration
160af6298daSManojkiran Eda
161af6298daSManojkiran Edaadd_project_arguments(
162f2caadceSEd Tanous    cxx.get_supported_arguments(
163f2caadceSEd Tanous        [
1646fd29553SEd Tanous            '-DBOOST_ASIO_DISABLE_CONCEPTS',
165af6298daSManojkiran Eda            '-DBOOST_ALL_NO_LIB',
16658e42b18SEd Tanous            '-DBOOST_ALLOW_DEPRECATED_HEADERS',
167f523c324SEd Tanous            '-DBOOST_ASIO_DISABLE_THREADS',
168f523c324SEd Tanous            '-DBOOST_ASIO_NO_DEPRECATED',
169f523c324SEd Tanous            '-DBOOST_ASIO_SEPARATE_COMPILATION',
170f523c324SEd Tanous            '-DBOOST_BEAST_SEPARATE_COMPILATION',
1719e710e7fSEd Tanous            '-DBOOST_EXCEPTION_DISABLE',
172f706551dSEd Tanous            '-DBOOST_NO_EXCEPTIONS',
173ab6b6fecSEd Tanous            '-DBOOST_URL_NO_SOURCE_LOCATION',
174f88b2170SEd Tanous            '-DBOOST_SPIRIT_X3_NO_RTTI',
1759e710e7fSEd Tanous            '-DJSON_NOEXCEPTION',
176209aa909SEd Tanous            '-DOPENSSL_NO_FILENAMES',
177f706551dSEd Tanous            '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES',
178f2caadceSEd Tanous        ],
179f2caadceSEd Tanous    ),
180f2caadceSEd Tanous    language: 'cpp',
181f2caadceSEd Tanous)
182af6298daSManojkiran Eda
183af6298daSManojkiran Eda# Find the dependency modules, if not found use meson wrap to get them
184af6298daSManojkiran Eda# automatically during the configure step
185ceb8ddc1SJason M. Billsbmcweb_dependencies = []
186af6298daSManojkiran Eda
1878682c5adSNan Zhoupam = cxx.find_library('pam', required: true)
188af6298daSManojkiran Edaatomic = cxx.find_library('atomic', required: true)
189e7923997SEd Tanousbmcweb_dependencies += [pam, atomic]
190e7923997SEd Tanous
191e7923997SEd Tanousopenssl = dependency('openssl', required: false, version: '>=3.0.0')
192e7923997SEd Tanousif not openssl.found() or get_option('b_sanitize') != 'none'
193e7923997SEd Tanous    openssl_proj = subproject(
194e7923997SEd Tanous        'openssl',
195e7923997SEd Tanous        required: true,
196f2caadceSEd Tanous        default_options: ['warning_level=0', 'werror=false'],
197e7923997SEd Tanous    )
198e7923997SEd Tanous    openssl = openssl_proj.get_variable('openssl_dep')
199e7923997SEd Tanous    openssl = openssl.as_system('system')
200e7923997SEd Tanousendif
201e7923997SEd Tanousbmcweb_dependencies += [openssl]
202af6298daSManojkiran Eda
203fca2cbeaSEd Tanousnghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false)
204fca2cbeaSEd Tanousif not nghttp2.found()
205fca2cbeaSEd Tanous    cmake = import('cmake')
206fca2cbeaSEd Tanous    opt_var = cmake.subproject_options()
207211cfa49SEd Tanous    opt_var.add_cmake_defines(
208211cfa49SEd Tanous        {
209211cfa49SEd Tanous            'ENABLE_LIB_ONLY': true,
210211cfa49SEd Tanous            'ENABLE_STATIC_LIB': true,
211211cfa49SEd Tanous        },
212211cfa49SEd Tanous    )
213fca2cbeaSEd Tanous    nghttp2_ex = cmake.subproject('nghttp2', options: opt_var)
214211cfa49SEd Tanous    nghttp2 = nghttp2_ex.dependency('nghttp2')
215fca2cbeaSEd Tanousendif
216fca2cbeaSEd Tanousbmcweb_dependencies += nghttp2
217fca2cbeaSEd Tanous
2187bb985eeSEd Tanoussdbusplus = dependency('sdbusplus', required: false, include_type: 'system')
219af6298daSManojkiran Edaif not sdbusplus.found()
220af6298daSManojkiran Eda    sdbusplus_proj = subproject('sdbusplus', required: true)
221af6298daSManojkiran Eda    sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
222af6298daSManojkiran Eda    sdbusplus = sdbusplus.as_system('system')
223af6298daSManojkiran Edaendif
224ceb8ddc1SJason M. Billsbmcweb_dependencies += sdbusplus
225af6298daSManojkiran Eda
226c9374ff6SEd Tanoustinyxml = dependency(
227c9374ff6SEd Tanous    'tinyxml2',
228565c0911SPatrick Williams    include_type: 'system',
229c9374ff6SEd Tanous    version: '>=9.0.0',
23060e299bdSKonstantin Aladyshev    default_options: ['tests=false'],
231565c0911SPatrick Williams)
232c9374ff6SEd Tanousif not tinyxml.found()
233c9374ff6SEd Tanous    tinyxml_proj = subproject('tinyxml2', required: true)
234c9374ff6SEd Tanous    tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
235c9374ff6SEd Tanous    tinyxml = tinyxml.as_system('system')
236c9374ff6SEd Tanousendif
237ceb8ddc1SJason M. Billsbmcweb_dependencies += tinyxml
238af6298daSManojkiran Eda
239af6298daSManojkiran Edasystemd = dependency('systemd')
240af6298daSManojkiran Edazlib = dependency('zlib')
241ceb8ddc1SJason M. Billsbmcweb_dependencies += [systemd, zlib]
242af6298daSManojkiran Eda
243dfd5547bSPatrick Williamsnlohmann_json_dep = dependency('nlohmann_json', version: '>=3.11.2', include_type: 'system')
244dfd5547bSPatrick Williamsbmcweb_dependencies += nlohmann_json_dep
245af6298daSManojkiran Eda
2462b5b4daeSCarson Labradoboost = dependency(
2472b5b4daeSCarson Labrado    'boost',
2482b5b4daeSCarson Labrado    modules: [
2492b5b4daeSCarson Labrado        'url',
2502b5b4daeSCarson Labrado    ],
251619b8609SEd Tanous    version: '>=1.84.0',
2522b5b4daeSCarson Labrado    required: false,
253f2caadceSEd Tanous    include_type: 'system',
2542b5b4daeSCarson Labrado)
2556fd29553SEd Tanousif boost.found()
2566fd29553SEd Tanous    bmcweb_dependencies += [boost]
2576fd29553SEd Tanouselse
2586fd29553SEd Tanous    cmake = import('cmake')
2596fd29553SEd Tanous    opt = cmake.subproject_options()
260f2caadceSEd Tanous    opt.add_cmake_defines(
261f2caadceSEd Tanous        {
262f88b2170SEd Tanous            'BOOST_INCLUDE_LIBRARIES': 'asio;beast;callable_traits;headers;process;type_index;url;uuid;spirit',
263144983c5SEd Tanous            'BUILD_SHARED_LIBS': 'OFF',
264f2caadceSEd Tanous        },
265f2caadceSEd Tanous    )
266144983c5SEd Tanous
2676fd29553SEd Tanous    boost = cmake.subproject('boost', required: true, options: opt)
2682b5b4daeSCarson Labrado    boost_asio = boost.dependency('boost_asio').as_system()
2692b5b4daeSCarson Labrado    boost_beast = boost.dependency('boost_beast').as_system()
2702b5b4daeSCarson Labrado    boost_callable_traits = boost.dependency('boost_callable_traits').as_system()
2716fd29553SEd Tanous    boost_headers = boost.dependency('boost_headers').as_system()
2722b5b4daeSCarson Labrado    boost_process = boost.dependency('boost_process').as_system()
2732b5b4daeSCarson Labrado    boost_type_index = boost.dependency('boost_type_index').as_system()
2742b5b4daeSCarson Labrado    boost_url = boost.dependency('boost_url').as_system()
2752b5b4daeSCarson Labrado    boost_uuid = boost.dependency('boost_uuid').as_system()
276f88b2170SEd Tanous    boost_spirit = boost.dependency('boost_spirit').as_system()
2772b5b4daeSCarson Labrado    bmcweb_dependencies += [
2782b5b4daeSCarson Labrado        boost_asio,
2792b5b4daeSCarson Labrado        boost_beast,
2802b5b4daeSCarson Labrado        boost_callable_traits,
2812b5b4daeSCarson Labrado        boost_headers,
2822b5b4daeSCarson Labrado        boost_process,
2832b5b4daeSCarson Labrado        boost_type_index,
2842b5b4daeSCarson Labrado        boost_url,
285f2caadceSEd Tanous        boost_uuid,
286f88b2170SEd Tanous        boost_spirit,
2872b5b4daeSCarson Labrado    ]
288af6298daSManojkiran Edaendif
289af6298daSManojkiran Eda
290549bed29SPatrick Williamsif get_option('tests').allowed()
291f2caadceSEd Tanous    gtest = dependency(
292f2caadceSEd Tanous        'gtest',
293f2caadceSEd Tanous        main: true,
294f2caadceSEd Tanous        version: '>=1.14.0',
295f2caadceSEd Tanous        disabler: true,
296f2caadceSEd Tanous        required: false,
297f2caadceSEd Tanous    )
298af6298daSManojkiran Eda    gmock = dependency('gmock', required: false)
299549bed29SPatrick Williams    if not gtest.found() and get_option('tests').allowed()
300af6298daSManojkiran Eda        gtest_proj = subproject('gtest', required: true)
301af6298daSManojkiran Eda        gtest = gtest_proj.get_variable('gtest_main_dep')
302af6298daSManojkiran Eda        gmock = gtest_proj.get_variable('gmock_dep')
303af6298daSManojkiran Eda    endif
304b00dcc27SEd Tanous    gtest = gtest.as_system('system')
305b00dcc27SEd Tanous    gmock = gmock.as_system('system')
306af6298daSManojkiran Edaendif
307af6298daSManojkiran Eda
3084efe3e0cSPatrick Williamssystemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
309af6298daSManojkiran Eda
310af6298daSManojkiran Edabindir = get_option('prefix') + '/' + get_option('bindir')
311af6298daSManojkiran Eda
312f2caadceSEd Tanoussummary(
313f2caadceSEd Tanous    {
314af6298daSManojkiran Eda        'prefix': get_option('prefix'),
315af6298daSManojkiran Eda        'bindir': bindir,
316f2caadceSEd Tanous        'systemd unit directory': systemd_system_unit_dir,
317f2caadceSEd Tanous    },
318f2caadceSEd Tanous    section: 'Directories',
319f2caadceSEd Tanous)
320af6298daSManojkiran Eda
3211fc21359SEd Tanousinstall_subdir('static', install_dir: 'share/www', strip_directory: true, follow_symlinks: true)
322af6298daSManojkiran Eda
323307386e8SNan Zhou# Config subdirectory
324307386e8SNan Zhou
325307386e8SNan Zhousubdir('config')
326307386e8SNan Zhoubmcweb_dependencies += conf_h_dep
327307386e8SNan Zhou
32802f1cd9bSEd Tanous# Source files
3290ad63df8SNan Zhoufs = import('fs')
330af6298daSManojkiran Eda
3310ad63df8SNan Zhousrcfiles_bmcweb = files(
3323cd7072bSEd Tanous    # end large files
3333cd7072bSEd Tanous
33402f1cd9bSEd Tanous    'redfish-core/src/error_messages.cpp',
335f2caadceSEd Tanous    # Begin large files, should be at the beginning
336*25991f7dSEd Tanous    'redfish-core/src/filter_expr_executor.cpp',
337f88b2170SEd Tanous    'redfish-core/src/filter_expr_printer.cpp',
338f2caadceSEd Tanous    'redfish-core/src/redfish.cpp',
339d1d411f9SSui Chen    'redfish-core/src/registries.cpp',
340d02aad39SEd Tanous    'redfish-core/src/utils/dbus_utils.cpp',
34102f1cd9bSEd Tanous    'redfish-core/src/utils/json_utils.cpp',
3423cd7072bSEd Tanous    'redfish-core/src/utils/time_utils.cpp',
343f523c324SEd Tanous    'src/boost_asio.cpp',
344f2caadceSEd Tanous    'src/boost_asio_ssl.cpp',
345f523c324SEd Tanous    'src/boost_beast.cpp',
3466384e323SNan Zhou    'src/dbus_singleton.cpp',
34761e349acSEd Tanous    'src/json_html_serializer.cpp',
3482c6ffdb0SEd Tanous    'src/ossl_random.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',
398*25991f7dSEd 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',
407c33a039bSNan Zhou    'test/redfish-core/include/utils/stl_utils_test.cpp',
408c33a039bSNan Zhou    'test/redfish-core/include/utils/time_utils_test.cpp',
409c33a039bSNan Zhou    'test/redfish-core/lib/chassis_test.cpp',
410c33a039bSNan Zhou    'test/redfish-core/lib/log_services_dump_test.cpp',
41175e8e218SMyung Bae    'test/redfish-core/lib/log_services_test.cpp',
412e610b316SJagpal Singh Gill    'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
413090ab8e1SEd Tanous    'test/redfish-core/lib/metadata_test.cpp',
414f2caadceSEd Tanous    'test/redfish-core/lib/power_subsystem_test.cpp',
415f2caadceSEd Tanous    'test/redfish-core/lib/sensors_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