| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 1 | project('bmcweb', 'cpp', | 
 | 2 |         version : '1.0', | 
 | 3 |         meson_version: '>=0.53.2', | 
 | 4 |         default_options: [ | 
 | 5 |             'werror=true', | 
 | 6 |             'warning_level=3', | 
 | 7 |             'cpp_std=c++17', | 
 | 8 |             'buildtype=debugoptimized', | 
 | 9 |             'b_ndebug=if-release', | 
 | 10 |             'b_lto=true', | 
 | 11 | # enable when https://github.com/chriskohlhoff/asio/issues/533 | 
 | 12 | # is resolved. ASIO default executor doesn't build with no-rtti | 
 | 13 |            #'cpp_rtti=false' | 
 | 14 |            ]) | 
 | 15 |  | 
 | 16 | # Project related links | 
 | 17 |  | 
 | 18 | project_pretty_name = 'bmcweb' | 
 | 19 | project_url = 'https://github.com/openbmc/' + project_pretty_name | 
 | 20 | project_issues_url = project_url + '/issues/new' | 
 | 21 | summary('Issues',project_issues_url, section: 'Report Issues') | 
 | 22 |  | 
 | 23 | # Validate the c++ Standard | 
 | 24 |  | 
 | 25 | if get_option('cpp_std') != 'c++17' | 
 | 26 |     error('This project requires c++17 support') | 
 | 27 | endif | 
 | 28 |  | 
 | 29 | # Get compiler and default build type | 
 | 30 |  | 
 | 31 | cxx = meson.get_compiler('cpp') | 
 | 32 | build = get_option('buildtype') | 
 | 33 | optimization = get_option('optimization') | 
 | 34 | summary('Build Type',build, section : 'Build Info') | 
 | 35 | summary('Optimization',optimization, section : 'Build Info') | 
 | 36 |  | 
 | 37 | # remove debug information for minsize buildtype | 
 | 38 | if(get_option('buildtype') == 'minsize') | 
 | 39 |   add_project_arguments('-DNDEBUG', language : 'cpp') | 
 | 40 | endif | 
 | 41 |  | 
 | 42 | # Disable lto when compiling with no optimization | 
 | 43 | if(get_option('optimization') == '0') | 
 | 44 |   add_project_arguments('-fno-lto', language: 'cpp') | 
 | 45 |   message('Disabling lto & its supported features as optimization is disabled') | 
 | 46 | endif | 
 | 47 |  | 
 | 48 | # Include Directories | 
 | 49 |  | 
 | 50 | incdir = include_directories('include','redfish-core/include', | 
 | 51 |                              'redfish-core/lib','http') | 
 | 52 |  | 
 | 53 | # Get the options and enable the respective features | 
 | 54 | ## create a MAP of  "options : feature_flag" | 
 | 55 |  | 
 | 56 | feature_map = { | 
 | 57 | 'insecure-disable-auth'           : '-DBMCWEB_INSECURE_DISABLE_AUTHENTICATION', | 
 | 58 | 'insecure-disable-csrf'           : '-DBMCWEB_INSECURE_DISABLE_CSRF_PREVENTION', | 
 | 59 | 'insecure-disable-ssl'            : '-DBMCWEB_INSECURE_DISABLE_SSL', | 
 | 60 | 'insecure-disable-xss'            : '-DBMCWEB_INSECURE_DISABLE_XSS_PREVENTION', | 
 | 61 | 'host-serial-socket'              : '-DBMCWEB_ENABLE_HOST_SERIAL_WEBSOCKET', | 
 | 62 | 'ibm-management-console'          : '-DBMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE', | 
 | 63 | 'kvm'                             : '-DBMCWEB_ENABLE_KVM' , | 
| Alan Kuo | f16f626 | 2020-12-08 19:29:59 +0800 | [diff] [blame] | 64 | 'basic-auth'                      : '-DBMCWEB_ENABLE_BASIC_AUTHENTICATION', | 
 | 65 | 'session-auth'                    : '-DBMCWEB_ENABLE_SESSION_AUTHENTICATION', | 
 | 66 | 'xtoken-auth'                     : '-DBMCWEB_ENABLE_XTOKEN_AUTHENTICATION', | 
 | 67 | 'cookie-auth'                     : '-DBMCWEB_ENABLE_COOKIE_AUTHENTICATION', | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 68 | 'mutual-tls-auth'                 : '-DBMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION', | 
 | 69 | 'pam'                             : '-DWEBSERVER_ENABLE_PAM', | 
 | 70 | 'insecure-push-style-notification': '-DBMCWEB_INSECURE_ENABLE_HTTP_PUSH_STYLE_EVENTING', | 
 | 71 | 'redfish'                         : '-DBMCWEB_ENABLE_REDFISH', | 
 | 72 | 'redfish-bmc-journal'             : '-DBMCWEB_ENABLE_REDFISH_BMC_JOURNAL', | 
 | 73 | 'redfish-cpu-log'                 : '-DBMCWEB_ENABLE_REDFISH_CPU_LOG', | 
 | 74 | 'redfish-dbus-log'                : '-DBMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES', | 
 | 75 | 'redfish-provisioning-feature'    : '-DBMCWEB_ENABLE_REDFISH_PROVISIONING_FEATURE', | 
 | 76 | 'redfish-raw-peci'                : '-DBMCWEB_ENABLE_REDFISH_RAW_PECI', | 
| Ravi Teja | 3fad0d5 | 2020-10-16 11:18:02 -0500 | [diff] [blame] | 77 | 'redfish-dump-log'                : '-DBMCWEB_ENABLE_REDFISH_DUMP_LOG', | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 78 | 'rest'                            : '-DBMCWEB_ENABLE_DBUS_REST', | 
 | 79 | 'insecure-sensor-override'        : '-DBMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', | 
 | 80 | 'static-hosting'                  : '-DBMCWEB_ENABLE_STATIC_HOSTING', | 
 | 81 | 'insecure-tftp-update'            : '-DBMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE', | 
 | 82 | 'validate-unsecure-feature'       : '-DBMCWEB_ENABLE_VALIDATION_UNSECURE_FEATURE', | 
 | 83 | 'vm-nbdproxy'                     : '-DBMCWEB_ENABLE_VM_NBDPROXY', | 
 | 84 | 'vm-websocket'                    : '-DBMCWEB_ENABLE_VM_WEBSOCKET', | 
 | 85 | } | 
 | 86 |  | 
 | 87 | # Get the options status and build a project summary to show which flags are | 
 | 88 | # being enabled during the configuration time. | 
 | 89 |  | 
 | 90 | foreach option_key,option_value : feature_map | 
 | 91 |   if(get_option(option_key).enabled()) | 
 | 92 |     if(option_key == 'mutual-tls-auth' or option_key == 'insecure-disable-ssl') | 
 | 93 |       if(get_option('insecure-disable-ssl').disabled() or get_option('mutual-tls-auth').disabled()) | 
 | 94 |         add_project_arguments(option_value,language:'cpp') | 
 | 95 |         summary(option_key,option_value, section : 'Enabled Features') | 
 | 96 |       endif | 
 | 97 |     else | 
 | 98 |       summary(option_key,option_value, section : 'Enabled Features') | 
 | 99 |       add_project_arguments(option_value,language:'cpp') | 
 | 100 |     endif | 
 | 101 |   else | 
 | 102 |       if(option_key == 'insecure-disable-ssl') | 
 | 103 |         summary('ssl','-DBMCWEB_ENABLE_SSL', section : 'Enabled Features') | 
 | 104 |         add_project_arguments('-DBMCWEB_ENABLE_SSL', language : 'cpp') | 
 | 105 |       endif | 
 | 106 |   endif | 
 | 107 | endforeach | 
 | 108 |  | 
 | 109 | if(get_option('tests').enabled()) | 
 | 110 |   summary('unittest','NA', section : 'Enabled Features') | 
 | 111 | endif | 
 | 112 |  | 
 | 113 | if get_option('yocto-deps').disabled() | 
 | 114 |   # This is an out of tree build, so enable ibm console flag | 
 | 115 |   # for CI purpose. | 
 | 116 |   add_project_arguments('-DBMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE', language: 'cpp') | 
 | 117 |   summary('ibm-management-console','-DBMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE',section : 'Enabled Features') | 
 | 118 | endif | 
 | 119 |  | 
 | 120 | # Add compiler arguments | 
 | 121 |  | 
 | 122 | # -Wpedantic, -Wextra comes by default with warning level | 
 | 123 | add_project_arguments( | 
 | 124 |   cxx.get_supported_arguments([ | 
 | 125 |   '-Wold-style-cast', | 
 | 126 |   '-Wcast-align', | 
 | 127 |   '-Wunused', | 
 | 128 |   '-Woverloaded-virtual', | 
 | 129 |   '-Wconversion', | 
 | 130 |   '-Wsign-conversion', | 
 | 131 |   '-Wno-attributes', | 
 | 132 |   ]), | 
 | 133 |   language: 'cpp' | 
 | 134 | ) | 
 | 135 |  | 
 | 136 | if (cxx.get_id() == 'clang' and cxx.version().version_compare('>9.0')) | 
 | 137 | add_project_arguments( | 
 | 138 |   cxx.get_supported_arguments([ | 
 | 139 |     '-Weverything', | 
 | 140 |     '-Wno-c++98-compat', | 
 | 141 |     '-Wno-c++98-compat-pedantic', | 
 | 142 |     '-Wno-global-constructors', | 
 | 143 |     '-Wno-exit-time-destructors', | 
 | 144 |     '-Wno-shadow', | 
 | 145 |     '-Wno-used-but-marked-unused', | 
 | 146 |     '-Wno-documentation-unknown-command', | 
 | 147 |     '-Wno-weak-vtables', | 
 | 148 |     '-Wno-documentation', | 
 | 149 |     '-Wno-padded', | 
 | 150 |     '-Wunused-parameter', | 
 | 151 |     '-Wcovered-switch-default', | 
 | 152 |     '-Wcomma', | 
 | 153 |     '-Wextra-semi', | 
 | 154 |     '-Wzero-as-null-pointer-constant', | 
 | 155 |     '-Wswitch-enum', | 
 | 156 |     '-Wnull-dereference', | 
 | 157 |     '-Wdouble-promotion', | 
 | 158 |     '-Wformat=2', | 
 | 159 |   ]), | 
 | 160 |   language:'cpp') | 
 | 161 | endif | 
 | 162 |  | 
 | 163 | # if compiler is gnu-gcc , and version is > 8.0 then we add few more | 
 | 164 | # compiler arguments , we know that will pass | 
 | 165 |  | 
 | 166 | if (cxx.get_id() == 'gcc' and cxx.version().version_compare('>8.0')) | 
 | 167 |  | 
 | 168 |   ## remove once bmcweb/issues/147 is fixed | 
 | 169 |   add_global_link_arguments('-Wno-stringop-overflow',language:['c','cpp']) | 
 | 170 |   add_project_arguments('-Wno-stringop-overflow',language:['c','cpp']) | 
 | 171 |  | 
 | 172 |   add_project_arguments( | 
 | 173 |     cxx.get_supported_arguments([ | 
 | 174 |      '-Wduplicated-cond', | 
 | 175 |      '-Wduplicated-branches', | 
 | 176 |      '-Wlogical-op', | 
 | 177 |      '-Wunused-parameter', | 
 | 178 |      '-Wnull-dereference', | 
 | 179 |      '-Wdouble-promotion', | 
 | 180 |      '-Wformat=2', | 
 | 181 |      ]), | 
 | 182 |     language:'cpp') | 
 | 183 |  | 
 | 184 |   if (get_option('buildtype') != 'plain') | 
 | 185 |     if (get_option('b_lto') == true and get_option('optimization')!='0') | 
 | 186 |       # Reduce the binary size by removing unnecessary | 
 | 187 |       # dynamic symbol table entries | 
 | 188 |  | 
 | 189 |       add_project_arguments( | 
 | 190 |        cxx.get_supported_arguments([ | 
 | 191 |        '-fno-fat-lto-objects', | 
 | 192 |        '-fvisibility=hidden', | 
 | 193 |        '-fvisibility-inlines-hidden' | 
 | 194 |        ]), | 
 | 195 |        language: 'cpp') | 
 | 196 |  | 
 | 197 |       if cxx.has_link_argument('-Wl,--exclude-libs,ALL') | 
 | 198 |         add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp') | 
 | 199 |       endif | 
 | 200 |   endif | 
 | 201 |  | 
| Manojkiran Eda | 620a6e1 | 2020-10-04 21:02:02 +0530 | [diff] [blame] | 202 |     if( get_option('bmcweb-logging').enabled() or \ | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 203 |         get_option('buildtype').startswith('debug')) | 
 | 204 |      add_project_arguments([ | 
 | 205 |        '-DBMCWEB_ENABLE_LOGGING', | 
 | 206 |        '-DBMCWEB_ENABLE_DEBUG' | 
 | 207 |        ], | 
 | 208 |       language : 'cpp') | 
 | 209 |  | 
 | 210 |       summary({'debug' :'-DBMCWEB_ENABLE_DEBUG', | 
 | 211 |                'logging' : '-DBMCWEB_ENABLE_LOGGING', | 
 | 212 |               },section : 'Enabled Features') | 
 | 213 |     endif | 
 | 214 |  | 
 | 215 |   endif | 
 | 216 | endif | 
 | 217 |  | 
 | 218 | # Set Compiler Security flags | 
 | 219 |  | 
 | 220 | security_flags = [ | 
 | 221 | '-fstack-protector-strong', | 
 | 222 | '-fPIE', | 
 | 223 | '-fPIC', | 
 | 224 | '-D_FORTIFY_SOURCE=2', | 
 | 225 | '-Wformat', | 
 | 226 | '-Wformat-security' | 
 | 227 | ] | 
 | 228 |  | 
 | 229 | ## Add security flags for builds of type 'release','debugoptimized' and 'minsize' | 
 | 230 |  | 
 | 231 | if not (get_option('buildtype') == 'plain' or get_option('buildtype').startswith('debug')) | 
 | 232 |   add_project_arguments( | 
 | 233 |    cxx.get_supported_arguments([ | 
 | 234 |     security_flags | 
 | 235 |   ]), | 
 | 236 |   language: 'cpp') | 
 | 237 | endif | 
 | 238 |  | 
 | 239 | # Boost dependency configuration | 
 | 240 |  | 
 | 241 | add_project_arguments( | 
 | 242 | cxx.get_supported_arguments([ | 
 | 243 | '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', | 
 | 244 | '-DBOOST_ASIO_DISABLE_THREADS', | 
 | 245 | '-DBOOST_BEAST_USE_STD_STRING_VIEW', | 
 | 246 | '-DBOOST_ERROR_CODE_HEADER_ONLY', | 
 | 247 | '-DBOOST_SYSTEM_NO_DEPRECATED', | 
 | 248 | '-DBOOST_ASIO_NO_DEPRECATED', | 
 | 249 | '-DBOOST_ALL_NO_LIB', | 
 | 250 | '-DBOOST_NO_RTTI', | 
 | 251 | '-DBOOST_NO_TYPEID', | 
 | 252 | '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING', | 
 | 253 | '-DBOOST_URL_STANDALONE', | 
| Ed Tanous | 19a8815 | 2021-01-11 12:50:47 -0800 | [diff] [blame] | 254 | '-DBOOST_URL_HEADER_ONLY', | 
 | 255 | '-DBOOST_ALLOW_DEPRECATED_HEADERS' | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 256 | ]), | 
 | 257 | language : 'cpp') | 
 | 258 |  | 
 | 259 | # Find the dependency modules, if not found use meson wrap to get them | 
 | 260 | # automatically during the configure step | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 261 | bmcweb_dependencies = [] | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 262 |  | 
 | 263 | pam = cxx.find_library('pam', required: get_option('pam')) | 
 | 264 | atomic =  cxx.find_library('atomic', required: true) | 
 | 265 | openssl = dependency('openssl', required : true) | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 266 | bmcweb_dependencies += [pam, atomic, openssl] | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 267 |  | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 268 | sdbusplus = dependency('sdbusplus',required : false) | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 269 | if not sdbusplus.found() | 
 | 270 |   sdbusplus_proj = subproject('sdbusplus', required: true) | 
 | 271 |   sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep') | 
 | 272 |   sdbusplus = sdbusplus.as_system('system') | 
 | 273 | endif | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 274 | bmcweb_dependencies += sdbusplus | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 275 |  | 
 | 276 | if get_option('rest').enabled() | 
 | 277 |   tinyxml = dependency('tinyxml2', required: false) | 
 | 278 |   if not tinyxml.found() | 
 | 279 |     tinyxml_proj = subproject('tinyxml2', required: true) | 
 | 280 |     tinyxml = tinyxml_proj.get_variable('tinyxml2_dep') | 
 | 281 |     tinyxml = tinyxml.as_system('system') | 
 | 282 |   endif | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 283 |   bmcweb_dependencies += tinyxml | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 284 | endif | 
 | 285 |  | 
 | 286 | systemd = dependency('systemd') | 
 | 287 | zlib = dependency('zlib') | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 288 | bmcweb_dependencies += [systemd, zlib] | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 289 |  | 
 | 290 | if cxx.has_header('nlohmann/json.hpp') | 
 | 291 |     nlohmann_json = declare_dependency() | 
 | 292 | else | 
 | 293 |     subproject('nlohmann', required: false) | 
 | 294 |     nlohmann_json = declare_dependency( | 
 | 295 |         include_directories: [ | 
 | 296 |             'subprojects/nlohmann/single_include', | 
 | 297 |             'subprojects/nlohmann/single_include/nlohmann', | 
 | 298 |         ] | 
 | 299 |     ) | 
 | 300 | endif | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 301 | bmcweb_dependencies += nlohmann_json | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 302 |  | 
| Ed Tanous | 309b083 | 2020-10-06 14:39:08 -0700 | [diff] [blame] | 303 | boost = dependency('boost',version : '>=1.73.0', required : false) | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 304 | if not boost.found() | 
 | 305 |   subproject('boost', required: false) | 
 | 306 |   boost_inc = include_directories('subprojects/boost_1_73_0/', is_system:true) | 
 | 307 |   boost  = declare_dependency(include_directories : boost_inc) | 
 | 308 | endif | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 309 | bmcweb_dependencies += boost | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 310 |  | 
 | 311 | if cxx.has_header('boost/url/url_view.hpp') | 
 | 312 |   boost_url = declare_dependency() | 
 | 313 | else | 
 | 314 |   subproject('boost-url', required: false) | 
 | 315 |   boost_url_inc = include_directories('subprojects/boost-url/include', is_system:true) | 
 | 316 |   boost_url= declare_dependency(include_directories : boost_url_inc) | 
 | 317 | endif | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 318 | bmcweb_dependencies += boost_url | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 319 |  | 
 | 320 | if get_option('tests').enabled() | 
 | 321 |   gtest = dependency('gtest', main: true,disabler: true, required : false) | 
 | 322 |   gmock = dependency('gmock', required : false) | 
 | 323 |   if not gtest.found() and get_option('tests').enabled() | 
 | 324 |     gtest_proj = subproject('gtest', required: true) | 
 | 325 |     gtest = gtest_proj.get_variable('gtest_main_dep') | 
 | 326 |     gmock = gtest_proj.get_variable('gmock_dep') | 
 | 327 |   endif | 
 | 328 | endif | 
 | 329 |  | 
 | 330 | # Source files | 
 | 331 |  | 
 | 332 | srcfiles_bmcweb = ['src/webserver_main.cpp','redfish-core/src/error_messages.cpp', | 
 | 333 |                    'redfish-core/src/utils/json_utils.cpp'] | 
 | 334 |  | 
| Manojkiran Eda | 17a897d | 2020-09-12 15:31:58 +0530 | [diff] [blame] | 335 | srcfiles_unittest = ['include/ut/dbus_utility_test.cpp', | 
 | 336 |                      'redfish-core/ut/privileges_test.cpp', | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 337 |                      'redfish-core/ut/lock_test.cpp', | 
 | 338 |                      'http/ut/utility_test.cpp'] | 
 | 339 |  | 
 | 340 | # Gather the Configuration data | 
 | 341 |  | 
 | 342 | conf_data = configuration_data() | 
 | 343 | conf_data.set('BMCWEB_HTTP_REQ_BODY_LIMIT_MB',get_option('http-body-limit')) | 
 | 344 | conf_data.set('MESON_INSTALL_PREFIX',get_option('prefix')) | 
 | 345 | configure_file(output: 'config.h', | 
 | 346 |                configuration: conf_data) | 
 | 347 |  | 
 | 348 | # Configure and install systemd unit files | 
 | 349 |  | 
 | 350 | systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir') | 
 | 351 |  | 
 | 352 | bindir = get_option('prefix') + '/' +get_option('bindir') | 
 | 353 |  | 
 | 354 | summary({ | 
 | 355 |           'prefix' : get_option('prefix'), | 
 | 356 |           'bindir' : bindir, | 
 | 357 |           'systemd unit directory' : systemd_system_unit_dir | 
 | 358 |         }, section : 'Directories') | 
 | 359 |  | 
 | 360 | configure_file(input : 'bmcweb.socket', | 
 | 361 |                output : 'bmcweb.socket', | 
 | 362 |                copy : true, | 
 | 363 |                install_dir: systemd_system_unit_dir, | 
 | 364 |                install : true) | 
 | 365 |  | 
 | 366 | configure_file(input : 'bmcweb.service.in', | 
 | 367 |                output : 'bmcweb.service', | 
 | 368 |                install_dir: systemd_system_unit_dir, | 
 | 369 |                configuration: conf_data, | 
 | 370 |                install : true) | 
 | 371 |  | 
 | 372 | # Copy pam-webserver to etc/pam.d | 
 | 373 | configure_file(input : 'pam-webserver', | 
 | 374 |                output : 'webserver', | 
 | 375 |                copy : true, | 
 | 376 |                install_dir: '/etc/pam.d', | 
 | 377 |                install : true) | 
 | 378 |  | 
 | 379 | install_subdir('static', install_dir : 'share/www', strip_directory : true) | 
 | 380 |  | 
 | 381 | # Generate the bmcweb executable and the test binary | 
 | 382 |  | 
 | 383 | executable('bmcweb',srcfiles_bmcweb, | 
 | 384 |             include_directories : incdir, | 
| Jason M. Bills | ceb8ddc | 2020-11-23 14:38:39 -0800 | [diff] [blame] | 385 |             dependencies: bmcweb_dependencies, | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 386 |             install: true, | 
 | 387 |             install_dir:bindir) | 
 | 388 |  | 
 | 389 | if(get_option('tests').enabled()) | 
 | 390 |   foreach src_test : srcfiles_unittest | 
 | 391 |     testname = src_test.split('/')[-1].split('.')[0] | 
 | 392 |     test(testname,executable(testname,src_test, | 
 | 393 |                 include_directories : incdir, | 
 | 394 |                 install_dir: bindir, | 
 | 395 |                 dependencies: [ | 
| Sathish V | ae907c7 | 2020-12-02 17:49:34 +0530 | [diff] [blame] | 396 |                                 boost, boost_url, gtest,openssl,gmock,nlohmann_json,sdbusplus | 
| Manojkiran Eda | af6298d | 2020-05-27 08:51:32 +0530 | [diff] [blame] | 397 |                               ])) | 
 | 398 |   endforeach | 
 | 399 | endif |