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') 4292e26be5SEd Tanous add_project_arguments( 4392e26be5SEd Tanous ['-fdata-sections', '-ffunction-sections'], 4492e26be5SEd Tanous language: 'cpp', 4592e26be5SEd Tanous ) 46af6298daSManojkiran Eda add_project_arguments('-DNDEBUG', language: 'cpp') 47af6298daSManojkiran Edaendif 48af6298daSManojkiran Eda 49f8ca6d79SEd Tanousif (get_option('dns-resolver') == 'systemd-dbus') 50f8ca6d79SEd Tanous add_project_arguments('-DBMCWEB_DBUS_DNS_RESOLVER', language: 'cpp') 51f8ca6d79SEd Tanousendif 52f8ca6d79SEd Tanous 53af6298daSManojkiran Eda# Disable lto when compiling with no optimization 54af6298daSManojkiran Edaif (get_option('optimization') == '0') 55af6298daSManojkiran Eda add_project_arguments('-fno-lto', language: 'cpp') 56af6298daSManojkiran Eda message('Disabling lto & its supported features as optimization is disabled') 57af6298daSManojkiran Edaendif 58af6298daSManojkiran Eda 59af6298daSManojkiran Eda# Include Directories 60af6298daSManojkiran Eda 6192e26be5SEd Tanousincdir = include_directories( 6292e26be5SEd Tanous 'include', 6392e26be5SEd Tanous 'redfish-core/include', 6492e26be5SEd Tanous 'redfish-core/lib', 65bd1299b7SAushim Nagarkatti 'http', 66bd1299b7SAushim Nagarkatti) 6792e26be5SEd Tanousincdir_cli = include_directories('http', 'include') 68af6298daSManojkiran Eda 69549bed29SPatrick Williamsif (get_option('tests').allowed()) 7025b54dbaSEd Tanous summary('unittest', 'NA', section: 'Features') 71af6298daSManojkiran Edaendif 72af6298daSManojkiran Eda 73af6298daSManojkiran Eda# Add compiler arguments 74af6298daSManojkiran Eda 75ade3f093SEd Tanousif (cxx.get_id() == 'clang') 76ade3f093SEd Tanous if (cxx.version().version_compare('<17.0')) 77ade3f093SEd Tanous error('This project requires clang-17 or higher') 78ade3f093SEd Tanous endif 79af6298daSManojkiran Eda add_project_arguments( 80af6298daSManojkiran Eda '-Weverything', 81ade3f093SEd Tanous '-Wformat=2', 82af6298daSManojkiran Eda '-Wno-c++98-compat-pedantic', 83f523c324SEd Tanous '-Wno-c++98-compat', 8425991f7dSEd Tanous '-Wno-c++20-extensions', 85f523c324SEd Tanous '-Wno-documentation-unknown-command', 86f523c324SEd Tanous '-Wno-documentation', 87af6298daSManojkiran Eda '-Wno-exit-time-destructors', 88f523c324SEd Tanous '-Wno-global-constructors', 89f523c324SEd Tanous '-Wno-newline-eof', 90f523c324SEd Tanous '-Wno-padded', 91af6298daSManojkiran Eda '-Wno-shadow', 92af6298daSManojkiran Eda '-Wno-used-but-marked-unused', 93af6298daSManojkiran Eda '-Wno-weak-vtables', 94e6801eb4SEd Tanous '-Wno-switch-enum', 9572b90760SEd Tanous '-Wno-unused-macros', 964da0490bSEd Tanous '-Wno-covered-switch-default', 97f88b2170SEd Tanous '-Wno-disabled-macro-expansion', 98724985ffSEd Tanous '-Wno-unneeded-internal-declaration', 99f2caadceSEd Tanous language: 'cpp', 100f2caadceSEd Tanous ) 101af6298daSManojkiran Edaendif 102af6298daSManojkiran Eda 103ade3f093SEd Tanousif (cxx.get_id() == 'gcc') 104ade3f093SEd Tanous if (cxx.version().version_compare('<13.0')) 105ade3f093SEd Tanous error('This project requires gcc-13 or higher') 106ade3f093SEd Tanous endif 107af6298daSManojkiran Eda 108af6298daSManojkiran Eda add_project_arguments( 109ade3f093SEd Tanous '-Wformat=2', 110ade3f093SEd Tanous '-Wcast-align', 111ade3f093SEd Tanous '-Wconversion', 112ade3f093SEd Tanous '-Woverloaded-virtual', 113ade3f093SEd Tanous '-Wsign-conversion', 114ade3f093SEd Tanous '-Wunused', 115af6298daSManojkiran Eda '-Wduplicated-cond', 116af6298daSManojkiran Eda '-Wduplicated-branches', 117af6298daSManojkiran Eda '-Wlogical-op', 118af6298daSManojkiran Eda '-Wnull-dereference', 119079360aeSEd Tanous '-Wunused-parameter', 120af6298daSManojkiran Eda '-Wdouble-promotion', 1218a592810SEd Tanous '-Wshadow', 12230f11eb4SEd Tanous '-Wno-psabi', 123ade3f093SEd Tanous '-Wno-attributes', 124f2caadceSEd Tanous language: 'cpp', 125f2caadceSEd Tanous ) 126c66403c3SEd Tanousendif 127af6298daSManojkiran Eda 128af6298daSManojkiran Edaif (get_option('buildtype') != 'plain') 129af6298daSManojkiran Eda if (get_option('b_lto') == true and get_option('optimization') != '0') 130af6298daSManojkiran Eda # Reduce the binary size by removing unnecessary 131af6298daSManojkiran Eda # dynamic symbol table entries 132af6298daSManojkiran Eda 133af6298daSManojkiran Eda add_project_arguments( 134f2caadceSEd Tanous cxx.get_supported_arguments( 135f2caadceSEd Tanous [ 136af6298daSManojkiran Eda '-fno-fat-lto-objects', 137af6298daSManojkiran Eda '-fvisibility=hidden', 138f2caadceSEd Tanous '-fvisibility-inlines-hidden', 139f2caadceSEd Tanous ], 140f2caadceSEd Tanous ), 141f2caadceSEd Tanous language: 'cpp', 142f2caadceSEd Tanous ) 143af6298daSManojkiran Eda 144af6298daSManojkiran Eda if cxx.has_link_argument('-Wl,--exclude-libs,ALL') 145af6298daSManojkiran Eda add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp') 146af6298daSManojkiran Eda endif 147af6298daSManojkiran Eda endif 148c66403c3SEd Tanousendif 149af6298daSManojkiran Eda# Set Compiler Security flags 150af6298daSManojkiran Eda 151af6298daSManojkiran Edasecurity_flags = [ 152af6298daSManojkiran Eda '-fstack-protector-strong', 153af6298daSManojkiran Eda '-fPIE', 154af6298daSManojkiran Eda '-fPIC', 155af6298daSManojkiran Eda '-D_FORTIFY_SOURCE=2', 156af6298daSManojkiran Eda '-Wformat', 157f2caadceSEd Tanous '-Wformat-security', 158af6298daSManojkiran Eda] 159af6298daSManojkiran Eda 160af6298daSManojkiran Eda## Add security flags for builds of type 'release','debugoptimized' and 'minsize' 161af6298daSManojkiran Eda 16292e26be5SEd Tanousif not (get_option('buildtype') == 'plain' 163f2caadceSEd Tanousor get_option('buildtype').startswith('debug') 164f2caadceSEd Tanous) 16592e26be5SEd Tanous add_project_arguments( 16692e26be5SEd Tanous cxx.get_supported_arguments([security_flags]), 16792e26be5SEd Tanous language: 'cpp', 16892e26be5SEd Tanous ) 169af6298daSManojkiran Edaendif 170af6298daSManojkiran Eda 171af6298daSManojkiran Eda# Boost dependency configuration 172af6298daSManojkiran Eda 173af6298daSManojkiran Edaadd_project_arguments( 174f2caadceSEd Tanous cxx.get_supported_arguments( 175f2caadceSEd Tanous [ 1766fd29553SEd Tanous '-DBOOST_ASIO_DISABLE_CONCEPTS', 177af6298daSManojkiran Eda '-DBOOST_ALL_NO_LIB', 17858e42b18SEd Tanous '-DBOOST_ALLOW_DEPRECATED_HEADERS', 179f523c324SEd Tanous '-DBOOST_ASIO_DISABLE_THREADS', 180f523c324SEd Tanous '-DBOOST_ASIO_NO_DEPRECATED', 181f523c324SEd Tanous '-DBOOST_ASIO_SEPARATE_COMPILATION', 182f523c324SEd Tanous '-DBOOST_BEAST_SEPARATE_COMPILATION', 1839e710e7fSEd Tanous '-DBOOST_EXCEPTION_DISABLE', 184f706551dSEd Tanous '-DBOOST_NO_EXCEPTIONS', 185ab6b6fecSEd Tanous '-DBOOST_URL_NO_SOURCE_LOCATION', 186f88b2170SEd Tanous '-DBOOST_SPIRIT_X3_NO_RTTI', 1879e710e7fSEd Tanous '-DJSON_NOEXCEPTION', 188209aa909SEd Tanous '-DOPENSSL_NO_FILENAMES', 189f706551dSEd Tanous '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES', 190f2caadceSEd Tanous ], 191f2caadceSEd Tanous ), 192f2caadceSEd Tanous language: 'cpp', 193f2caadceSEd Tanous) 194af6298daSManojkiran Eda 195af6298daSManojkiran Eda# Find the dependency modules, if not found use meson wrap to get them 196af6298daSManojkiran Eda# automatically during the configure step 197ceb8ddc1SJason M. Billsbmcweb_dependencies = [] 198bd1299b7SAushim Nagarkattibmcweb_cli_dependencies = [] 199af6298daSManojkiran Eda 2008682c5adSNan Zhoupam = cxx.find_library('pam', required: true) 201af6298daSManojkiran Edaatomic = cxx.find_library('atomic', required: true) 202e7923997SEd Tanousbmcweb_dependencies += [pam, atomic] 203e7923997SEd Tanous 204e7923997SEd Tanousopenssl = dependency('openssl', required: false, version: '>=3.0.0') 205e7923997SEd Tanousif not openssl.found() or get_option('b_sanitize') != 'none' 206e7923997SEd Tanous openssl_proj = subproject( 207e7923997SEd Tanous 'openssl', 208e7923997SEd Tanous required: true, 209f2caadceSEd Tanous default_options: ['warning_level=0', 'werror=false'], 210e7923997SEd Tanous ) 211e7923997SEd Tanous openssl = openssl_proj.get_variable('openssl_dep') 212e7923997SEd Tanous openssl = openssl.as_system('system') 213e7923997SEd Tanousendif 214e7923997SEd Tanousbmcweb_dependencies += [openssl] 215af6298daSManojkiran Eda 216fca2cbeaSEd Tanousnghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false) 217fca2cbeaSEd Tanousif not nghttp2.found() 218fca2cbeaSEd Tanous cmake = import('cmake') 219fca2cbeaSEd Tanous opt_var = cmake.subproject_options() 220211cfa49SEd Tanous opt_var.add_cmake_defines( 22192e26be5SEd Tanous {'ENABLE_LIB_ONLY': true, 'ENABLE_STATIC_LIB': true}, 222211cfa49SEd Tanous ) 223fca2cbeaSEd Tanous nghttp2_ex = cmake.subproject('nghttp2', options: opt_var) 224211cfa49SEd Tanous nghttp2 = nghttp2_ex.dependency('nghttp2') 225fca2cbeaSEd Tanousendif 226fca2cbeaSEd Tanousbmcweb_dependencies += nghttp2 227fca2cbeaSEd Tanous 2287bb985eeSEd Tanoussdbusplus = dependency('sdbusplus', required: false, include_type: 'system') 229af6298daSManojkiran Edaif not sdbusplus.found() 230af6298daSManojkiran Eda sdbusplus_proj = subproject('sdbusplus', required: true) 231af6298daSManojkiran Eda sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep') 232af6298daSManojkiran Eda sdbusplus = sdbusplus.as_system('system') 233af6298daSManojkiran Edaendif 234ceb8ddc1SJason M. Billsbmcweb_dependencies += sdbusplus 235bd1299b7SAushim Nagarkattibmcweb_cli_dependencies += sdbusplus 236bd1299b7SAushim Nagarkatti 237bd1299b7SAushim Nagarkatticli11 = dependency('CLI11', required: false, include_type: 'system') 238bd1299b7SAushim Nagarkattiif not cli11.found() 239bd1299b7SAushim Nagarkatti cli11_proj = subproject('cli11', required: true) 240bd1299b7SAushim Nagarkatti cli11 = cli11_proj.get_variable('CLI11_dep') 241bd1299b7SAushim Nagarkatti cli11 = cli11.as_system('system') 242bd1299b7SAushim Nagarkattiendif 243bd1299b7SAushim Nagarkattibmcweb_cli_dependencies += cli11 244bd1299b7SAushim Nagarkatti 245af6298daSManojkiran Eda 246c9374ff6SEd Tanoustinyxml = dependency( 247c9374ff6SEd Tanous 'tinyxml2', 248565c0911SPatrick Williams include_type: 'system', 249c9374ff6SEd Tanous version: '>=9.0.0', 25060e299bdSKonstantin Aladyshev default_options: ['tests=false'], 251565c0911SPatrick Williams) 252c9374ff6SEd Tanousif not tinyxml.found() 253c9374ff6SEd Tanous tinyxml_proj = subproject('tinyxml2', required: true) 254c9374ff6SEd Tanous tinyxml = tinyxml_proj.get_variable('tinyxml_dep') 255c9374ff6SEd Tanous tinyxml = tinyxml.as_system('system') 256c9374ff6SEd Tanousendif 257ceb8ddc1SJason M. Billsbmcweb_dependencies += tinyxml 258af6298daSManojkiran Eda 259af6298daSManojkiran Edasystemd = dependency('systemd') 260058f54edSPatrick Williamslibsystemd = dependency('libsystemd') 261*77dcace6SEd Tanousadd_project_arguments( 262*77dcace6SEd Tanous '-DLIBSYSTEMD_VERSION=' + libsystemd.version(), 263*77dcace6SEd Tanous language: 'cpp', 264*77dcace6SEd Tanous) 265055713e4SEd Tanous 266af6298daSManojkiran Edazlib = dependency('zlib') 267058f54edSPatrick Williamsbmcweb_dependencies += [libsystemd, zlib] 268af6298daSManojkiran Eda 26992e26be5SEd Tanousnlohmann_json_dep = dependency( 27092e26be5SEd Tanous 'nlohmann_json', 27192e26be5SEd Tanous version: '>=3.11.2', 27292e26be5SEd Tanous include_type: 'system', 27392e26be5SEd Tanous) 274dfd5547bSPatrick Williamsbmcweb_dependencies += nlohmann_json_dep 275af6298daSManojkiran Eda 2762b5b4daeSCarson Labradoboost = dependency( 2772b5b4daeSCarson Labrado 'boost', 27892e26be5SEd Tanous modules: ['url'], 279619b8609SEd Tanous version: '>=1.84.0', 2802b5b4daeSCarson Labrado required: false, 281f2caadceSEd Tanous include_type: 'system', 2822b5b4daeSCarson Labrado) 2836fd29553SEd Tanousif boost.found() 2846fd29553SEd Tanous bmcweb_dependencies += [boost] 285bd1299b7SAushim Nagarkatti bmcweb_cli_dependencies += [boost] 2866fd29553SEd Tanouselse 2876fd29553SEd Tanous cmake = import('cmake') 2886fd29553SEd Tanous opt = cmake.subproject_options() 289f80a87f2SEd Tanous boost_libs = [ 290f80a87f2SEd Tanous 'asio', 291f80a87f2SEd Tanous 'beast', 292f80a87f2SEd Tanous 'circular_buffer', 293f80a87f2SEd Tanous 'callable_traits', 294f80a87f2SEd Tanous 'headers', 295f80a87f2SEd Tanous 'process', 296f80a87f2SEd Tanous 'type_index', 297f80a87f2SEd Tanous 'url', 298f80a87f2SEd Tanous 'uuid', 299f80a87f2SEd Tanous 'spirit', 300f80a87f2SEd Tanous ] 301f2caadceSEd Tanous opt.add_cmake_defines( 302f2caadceSEd Tanous { 3034ed30a8bSEd Tanous # 1.86.0 fails this. Hopefully fixed in 1.86.1 3044ed30a8bSEd Tanous 'CMAKE_CXX_FLAGS': '-Wno-unused-parameter', 305f80a87f2SEd Tanous 'BOOST_INCLUDE_LIBRARIES': ';'.join(boost_libs), 306144983c5SEd Tanous 'BUILD_SHARED_LIBS': 'OFF', 307f2caadceSEd Tanous }, 308f2caadceSEd Tanous ) 309144983c5SEd Tanous 3106fd29553SEd Tanous boost = cmake.subproject('boost', required: true, options: opt) 311f80a87f2SEd Tanous foreach boost_lib : boost_libs 312f80a87f2SEd Tanous boost_lib_instance = boost.dependency('boost_' + boost_lib).as_system() 313f80a87f2SEd Tanous bmcweb_dependencies += [boost_lib_instance] 314bd1299b7SAushim Nagarkatti bmcweb_cli_dependencies += [boost_lib_instance] 315f80a87f2SEd Tanous endforeach 316af6298daSManojkiran Edaendif 317af6298daSManojkiran Eda 3184efe3e0cSPatrick Williamssystemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir') 319af6298daSManojkiran Eda 320af6298daSManojkiran Edabindir = get_option('prefix') + '/' + get_option('bindir') 321bd1299b7SAushim Nagarkattilibexec = get_option('prefix') + '/' + get_option('libexecdir') 322af6298daSManojkiran Eda 323f2caadceSEd Tanoussummary( 324f2caadceSEd Tanous { 325af6298daSManojkiran Eda 'prefix': get_option('prefix'), 326af6298daSManojkiran Eda 'bindir': bindir, 327f2caadceSEd Tanous 'systemd unit directory': systemd_system_unit_dir, 328f2caadceSEd Tanous }, 329f2caadceSEd Tanous section: 'Directories', 330f2caadceSEd Tanous) 331af6298daSManojkiran Eda 332a529a6aaSEd Tanoussubdir('static') 333a529a6aaSEd Tanoussubdir('redfish-core') 334af6298daSManojkiran Eda 335307386e8SNan Zhou# Config subdirectory 336307386e8SNan Zhousubdir('config') 337307386e8SNan Zhoubmcweb_dependencies += conf_h_dep 338bd1299b7SAushim Nagarkattibmcweb_cli_dependencies += conf_h_dep 339307386e8SNan Zhou 34002f1cd9bSEd Tanous# Source files 3410ad63df8SNan Zhoufs = import('fs') 342af6298daSManojkiran Eda 3430ad63df8SNan Zhousrcfiles_bmcweb = files( 344724985ffSEd Tanous 'http/mutual_tls.cpp', 34502f1cd9bSEd Tanous 'redfish-core/src/error_messages.cpp', 34625991f7dSEd Tanous 'redfish-core/src/filter_expr_executor.cpp', 347f88b2170SEd Tanous 'redfish-core/src/filter_expr_printer.cpp', 348f2caadceSEd Tanous 'redfish-core/src/redfish.cpp', 349d1d411f9SSui Chen 'redfish-core/src/registries.cpp', 350d02aad39SEd Tanous 'redfish-core/src/utils/dbus_utils.cpp', 35102f1cd9bSEd Tanous 'redfish-core/src/utils/json_utils.cpp', 3523cd7072bSEd Tanous 'redfish-core/src/utils/time_utils.cpp', 353f523c324SEd Tanous 'src/boost_asio.cpp', 354f2caadceSEd Tanous 'src/boost_asio_ssl.cpp', 355f523c324SEd Tanous 'src/boost_beast.cpp', 3566384e323SNan Zhou 'src/dbus_singleton.cpp', 35761e349acSEd Tanous 'src/json_html_serializer.cpp', 3582c6ffdb0SEd Tanous 'src/ossl_random.cpp', 359724985ffSEd Tanous 'src/ssl_key_handler.cpp', 360f2caadceSEd Tanous 'src/webserver_run.cpp', 3610ad63df8SNan Zhou) 36202f1cd9bSEd Tanous 36342bbcd87SEd Tanousbmcweblib = static_library( 36442bbcd87SEd Tanous 'bmcweblib', 36542bbcd87SEd Tanous srcfiles_bmcweb, 36642bbcd87SEd Tanous include_directories: incdir, 36742bbcd87SEd Tanous dependencies: bmcweb_dependencies, 36842bbcd87SEd Tanous) 36942bbcd87SEd Tanous 370bd1299b7SAushim Nagarkatti# Generate the bmcwebd daemon 37102f1cd9bSEd Tanousexecutable( 372bd1299b7SAushim Nagarkatti 'bmcwebd', 37342bbcd87SEd Tanous 'src/webserver_main.cpp', 374af6298daSManojkiran Eda include_directories: incdir, 375ceb8ddc1SJason M. Bills dependencies: bmcweb_dependencies, 37642bbcd87SEd Tanous link_with: bmcweblib, 3775e34b67aSEd Tanous link_args: '-Wl,--gc-sections', 378af6298daSManojkiran Eda install: true, 37992e26be5SEd Tanous install_dir: libexec, 380bd1299b7SAushim Nagarkatti) 381bd1299b7SAushim Nagarkatti 382bd1299b7SAushim Nagarkatti# Generate the bmcweb CLI application 383bd1299b7SAushim Nagarkattiexecutable( 384bd1299b7SAushim Nagarkatti 'bmcweb', 385bd1299b7SAushim Nagarkatti ['src/webserver_cli.cpp', 'src/boost_asio.cpp'], 386bd1299b7SAushim Nagarkatti include_directories: incdir_cli, 387bd1299b7SAushim Nagarkatti dependencies: bmcweb_cli_dependencies, 388bd1299b7SAushim Nagarkatti install: true, 38992e26be5SEd Tanous install_dir: bindir, 39002f1cd9bSEd Tanous) 39102f1cd9bSEd Tanous 3920ad63df8SNan Zhousrcfiles_unittest = files( 393c33a039bSNan Zhou 'test/http/crow_getroutes_test.cpp', 39452dd6932SEd Tanous 'test/http/http2_connection_test.cpp', 395f2caadceSEd Tanous 'test/http/http_body_test.cpp', 3964fa45dffSEd Tanous 'test/http/http_connection_test.cpp', 3978e3f7032SAbhilash Raju 'test/http/http_response_test.cpp', 398f2caadceSEd Tanous 'test/http/mutual_tls.cpp', 399f2caadceSEd Tanous 'test/http/mutual_tls_meta.cpp', 400f2caadceSEd Tanous 'test/http/parsing_test.cpp', 401f2caadceSEd Tanous 'test/http/router_test.cpp', 402f2caadceSEd Tanous 'test/http/server_sent_event_test.cpp', 403c33a039bSNan Zhou 'test/http/utility_test.cpp', 4042c9efc3cSEd Tanous 'test/http/verb_test.cpp', 405e1452beaSEd Tanous 'test/include/async_resolve_test.cpp', 40611e8f60dSEd Tanous 'test/include/credential_pipe_test.cpp', 407f2caadceSEd Tanous 'test/include/dbus_utility_test.cpp', 408f2caadceSEd Tanous 'test/include/google/google_service_root_test.cpp', 409f2caadceSEd Tanous 'test/include/http_utility_test.cpp', 410f2caadceSEd Tanous 'test/include/human_sort_test.cpp', 411c33a039bSNan Zhou 'test/include/ibm/configfile_test.cpp', 412f2caadceSEd Tanous 'test/include/json_html_serializer.cpp', 413c33a039bSNan Zhou 'test/include/multipart_test.cpp', 414c33a039bSNan Zhou 'test/include/openbmc_dbus_rest_test.cpp', 4152c6ffdb0SEd Tanous 'test/include/ossl_random.cpp', 416099225ccSEd Tanous 'test/include/ssl_key_handler_test.cpp', 417f2caadceSEd Tanous 'test/include/str_utility_test.cpp', 41825991f7dSEd Tanous 'test/redfish-core/include/filter_expr_executor_test.cpp', 419f88b2170SEd Tanous 'test/redfish-core/include/filter_expr_parser_test.cpp', 42092e26be5SEd Tanous 'test/redfish-core/include/privileges_test.cpp', 4217e8890c5SCarson Labrado 'test/redfish-core/include/redfish_aggregator_test.cpp', 422c33a039bSNan Zhou 'test/redfish-core/include/registries_test.cpp', 423d02aad39SEd Tanous 'test/redfish-core/include/utils/dbus_utils.cpp', 424f2caadceSEd Tanous 'test/redfish-core/include/utils/hex_utils_test.cpp', 425c33a039bSNan Zhou 'test/redfish-core/include/utils/ip_utils_test.cpp', 426c33a039bSNan Zhou 'test/redfish-core/include/utils/json_utils_test.cpp', 427c33a039bSNan Zhou 'test/redfish-core/include/utils/query_param_test.cpp', 4281516c21bSJanet Adkins 'test/redfish-core/include/utils/sensor_utils_test.cpp', 429c33a039bSNan Zhou 'test/redfish-core/include/utils/stl_utils_test.cpp', 430c33a039bSNan Zhou 'test/redfish-core/include/utils/time_utils_test.cpp', 431c33a039bSNan Zhou 'test/redfish-core/lib/chassis_test.cpp', 432c33a039bSNan Zhou 'test/redfish-core/lib/log_services_dump_test.cpp', 433e610b316SJagpal Singh Gill 'test/redfish-core/lib/manager_diagnostic_data_test.cpp', 4348d2f868cSEd Tanous 'test/redfish-core/lib/manager_logservices_journal_test.cpp', 435090ab8e1SEd Tanous 'test/redfish-core/lib/metadata_test.cpp', 436f2caadceSEd Tanous 'test/redfish-core/lib/power_subsystem_test.cpp', 437f2caadceSEd Tanous 'test/redfish-core/lib/service_root_test.cpp', 438f2caadceSEd Tanous 'test/redfish-core/lib/system_test.cpp', 4398d2f868cSEd Tanous 'test/redfish-core/lib/systems_logservices_postcode.cpp', 440f2caadceSEd Tanous 'test/redfish-core/lib/thermal_subsystem_test.cpp', 441f2caadceSEd Tanous 'test/redfish-core/lib/update_service_test.cpp', 4420ad63df8SNan Zhou) 443af6298daSManojkiran Eda 444549bed29SPatrick Williamsif (get_option('tests').allowed()) 445*77dcace6SEd Tanous gtest = dependency( 446*77dcace6SEd Tanous 'gtest_main', 447*77dcace6SEd Tanous main: true, 448*77dcace6SEd Tanous version: '>=1.15.0', 449*77dcace6SEd Tanous required: true, 450*77dcace6SEd Tanous ) 451*77dcace6SEd Tanous gmock = dependency('gmock', required: true) 452*77dcace6SEd Tanous gtestlib = static_library('gtestlib', dependencies: [gtest, gmock]) 453*77dcace6SEd Tanous gtestdep = declare_dependency( 454*77dcace6SEd Tanous link_with: gtestlib, 455*77dcace6SEd Tanous dependencies: [ 456*77dcace6SEd Tanous gtest.partial_dependency(includes: true), 457*77dcace6SEd Tanous gmock.partial_dependency(includes: true), 458*77dcace6SEd Tanous ], 459*77dcace6SEd Tanous ) 46002f1cd9bSEd Tanous # generate the test executable 4610ad63df8SNan Zhou foreach test_src : srcfiles_unittest 4620ad63df8SNan Zhou test_bin = executable( 4630ad63df8SNan Zhou fs.stem(test_src), 46442bbcd87SEd Tanous test_src, 46542bbcd87SEd Tanous link_with: bmcweblib, 466af6298daSManojkiran Eda include_directories: incdir, 467af6298daSManojkiran Eda install_dir: bindir, 468*77dcace6SEd Tanous dependencies: bmcweb_dependencies + [gtestdep], 46902f1cd9bSEd Tanous ) 470*77dcace6SEd Tanous test(fs.stem(test_src), test_bin, protocol: 'gtest') 4710ad63df8SNan Zhou endforeach 472af6298daSManojkiran Edaendif 473