project(
    'bmcweb',
    'cpp',
    version: '1.0',
    meson_version: '>=0.63.0',
    default_options: [
        'b_lto_mode=default',
        'b_lto_threads=0',
        'b_lto=true',
        'b_ndebug=if-release',
        'buildtype=debugoptimized',
        'cpp_rtti=false',
        'cpp_std=c++20',
        'warning_level=3',
        'werror=true',
    ],
)

# Project related links

project_pretty_name = 'bmcweb'
project_url = 'https://github.com/openbmc/' + project_pretty_name
project_issues_url = project_url + '/issues/new'
summary('Issues', project_issues_url, section: 'Report Issues')

# Validate the c++ Standard

if get_option('cpp_std') != 'c++20'
    error('This project requires c++20 support')
endif

# Get compiler and default build type

cxx = meson.get_compiler('cpp')
build = get_option('buildtype')
optimization = get_option('optimization')
summary('Build Type', build, section: 'Build Info')
summary('Optimization', optimization, section: 'Build Info')

# remove debug information for minsize buildtype
if (get_option('buildtype') == 'minsize')
    add_project_arguments(['-fdata-sections', '-ffunction-sections'], language: 'cpp')
    add_project_arguments('-DNDEBUG', language: 'cpp')
endif

if (get_option('dns-resolver') == 'systemd-dbus')
    add_project_arguments('-DBMCWEB_DBUS_DNS_RESOLVER', language: 'cpp')
endif

# Disable lto when compiling with no optimization
if (get_option('optimization') == '0')
    add_project_arguments('-fno-lto', language: 'cpp')
    message('Disabling lto & its supported features as optimization is disabled')
endif

# Include Directories

incdir = include_directories('include', 'redfish-core/include', 'redfish-core/lib', 'http')

if (get_option('tests').allowed())
    summary('unittest', 'NA', section: 'Features')
endif

# Add compiler arguments

if (cxx.get_id() == 'clang')
    if (cxx.version().version_compare('<17.0'))
        error('This project requires clang-17 or higher')
    endif
    add_project_arguments(
        '-Weverything',
        '-Wformat=2',
        '-Wno-c++98-compat-pedantic',
        '-Wno-c++98-compat',
        '-Wno-documentation-unknown-command',
        '-Wno-documentation',
        '-Wno-exit-time-destructors',
        '-Wno-global-constructors',
        '-Wno-newline-eof',
        '-Wno-padded',
        '-Wno-shadow',
        '-Wno-used-but-marked-unused',
        '-Wno-weak-vtables',
        '-Wno-switch-enum',
        '-Wno-unused-macros',
        '-Wno-covered-switch-default',
        language: 'cpp',
    )
endif

if (cxx.get_id() == 'gcc')
    if (cxx.version().version_compare('<13.0'))
        error('This project requires gcc-13 or higher')
    endif

    add_project_arguments(
        '-Wformat=2',
        '-Wcast-align',
        '-Wconversion',
        '-Woverloaded-virtual',
        '-Wsign-conversion',
        '-Wunused',
        '-Wduplicated-cond',
        '-Wduplicated-branches',
        '-Wlogical-op',
        '-Wnull-dereference',
        '-Wunused-parameter',
        '-Wdouble-promotion',
        '-Wshadow',
        '-Wno-psabi',
        '-Wno-attributes',
        language: 'cpp',
    )
endif

if (get_option('buildtype') != 'plain')
    if (get_option('b_lto') == true and get_option('optimization') != '0')
        # Reduce the binary size by removing unnecessary
        # dynamic symbol table entries

        add_project_arguments(
            cxx.get_supported_arguments(
                [
                    '-fno-fat-lto-objects',
                    '-fvisibility=hidden',
                    '-fvisibility-inlines-hidden',
                ],
            ),
            language: 'cpp',
        )

        if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
            add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
        endif
    endif
endif
# Set Compiler Security flags

security_flags = [
    '-fstack-protector-strong',
    '-fPIE',
    '-fPIC',
    '-D_FORTIFY_SOURCE=2',
    '-Wformat',
    '-Wformat-security',
]

## Add security flags for builds of type 'release','debugoptimized' and 'minsize'

if not (
    get_option('buildtype') == 'plain'
    or get_option('buildtype').startswith('debug')
)
    add_project_arguments(cxx.get_supported_arguments([security_flags]), language: 'cpp')
endif

# Boost dependency configuration

add_project_arguments(
    cxx.get_supported_arguments(
        [
            '-DBOOST_ASIO_DISABLE_CONCEPTS',
            '-DBOOST_ALL_NO_LIB',
            '-DBOOST_ALLOW_DEPRECATED_HEADERS',
            '-DBOOST_ASIO_DISABLE_THREADS',
            '-DBOOST_ASIO_NO_DEPRECATED',
            '-DBOOST_ASIO_SEPARATE_COMPILATION',
            '-DBOOST_BEAST_SEPARATE_COMPILATION',
            '-DBOOST_EXCEPTION_DISABLE',
            '-DBOOST_NO_EXCEPTIONS',
            '-DBOOST_URL_NO_SOURCE_LOCATION',
            '-DJSON_NOEXCEPTION',
            '-DOPENSSL_NO_FILENAMES',
            '-DSDBUSPLUS_DISABLE_BOOST_COROUTINES',
        ],
    ),
    language: 'cpp',
)

# Find the dependency modules, if not found use meson wrap to get them
# automatically during the configure step
bmcweb_dependencies = []

pam = cxx.find_library('pam', required: true)
atomic = cxx.find_library('atomic', required: true)
bmcweb_dependencies += [pam, atomic]

openssl = dependency('openssl', required: false, version: '>=3.0.0')
if not openssl.found() or get_option('b_sanitize') != 'none'
    openssl_proj = subproject(
        'openssl',
        required: true,
        default_options: ['warning_level=0', 'werror=false'],
    )
    openssl = openssl_proj.get_variable('openssl_dep')
    openssl = openssl.as_system('system')
endif
bmcweb_dependencies += [openssl]

nghttp2 = dependency('libnghttp2', version: '>=1.52.0', required: false)
if not nghttp2.found()
    cmake = import('cmake')
    opt_var = cmake.subproject_options()
    opt_var.add_cmake_defines(
        {
            'ENABLE_LIB_ONLY': true,
            'ENABLE_STATIC_LIB': true,
        },
    )
    nghttp2_ex = cmake.subproject('nghttp2', options: opt_var)
    nghttp2 = nghttp2_ex.dependency('nghttp2')
endif
bmcweb_dependencies += nghttp2

sdbusplus = dependency('sdbusplus', required: false, include_type: 'system')
if not sdbusplus.found()
    sdbusplus_proj = subproject('sdbusplus', required: true)
    sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
    sdbusplus = sdbusplus.as_system('system')
endif
bmcweb_dependencies += sdbusplus

tinyxml = dependency(
    'tinyxml2',
    include_type: 'system',
    version: '>=9.0.0',
    default_options: ['tests=false'],
)
if not tinyxml.found()
    tinyxml_proj = subproject('tinyxml2', required: true)
    tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
    tinyxml = tinyxml.as_system('system')
endif
bmcweb_dependencies += tinyxml

systemd = dependency('systemd')
zlib = dependency('zlib')
bmcweb_dependencies += [systemd, zlib]

nlohmann_json_dep = dependency('nlohmann_json', version: '>=3.11.2', include_type: 'system')
bmcweb_dependencies += nlohmann_json_dep

boost = dependency(
    'boost',
    modules: [
        'url',
    ],
    version: '>=1.84.0',
    required: false,
    include_type: 'system',
)
if boost.found()
    bmcweb_dependencies += [boost]
else
    cmake = import('cmake')
    opt = cmake.subproject_options()
    opt.add_cmake_defines(
        {
            'BOOST_INCLUDE_LIBRARIES': 'asio;beast;callable_traits;headers;process;type_index;url;uuid',
            'BUILD_SHARED_LIBS': 'OFF',
        },
    )

    boost = cmake.subproject('boost', required: true, options: opt)
    boost_asio = boost.dependency('boost_asio').as_system()
    boost_beast = boost.dependency('boost_beast').as_system()
    boost_callable_traits = boost.dependency('boost_callable_traits').as_system()
    boost_headers = boost.dependency('boost_headers').as_system()
    boost_process = boost.dependency('boost_process').as_system()
    boost_type_index = boost.dependency('boost_type_index').as_system()
    boost_url = boost.dependency('boost_url').as_system()
    boost_uuid = boost.dependency('boost_uuid').as_system()
    bmcweb_dependencies += [
        boost_asio,
        boost_beast,
        boost_callable_traits,
        boost_headers,
        boost_process,
        boost_type_index,
        boost_url,
        boost_uuid,
    ]
endif

if get_option('tests').allowed()
    gtest = dependency(
        'gtest',
        main: true,
        version: '>=1.14.0',
        disabler: true,
        required: false,
    )
    gmock = dependency('gmock', required: false)
    if not gtest.found() and get_option('tests').allowed()
        gtest_proj = subproject('gtest', required: true)
        gtest = gtest_proj.get_variable('gtest_main_dep')
        gmock = gtest_proj.get_variable('gmock_dep')
    endif
    gtest = gtest.as_system('system')
    gmock = gmock.as_system('system')
endif

systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')

bindir = get_option('prefix') + '/' + get_option('bindir')

summary(
    {
        'prefix': get_option('prefix'),
        'bindir': bindir,
        'systemd unit directory': systemd_system_unit_dir,
    },
    section: 'Directories',
)

install_subdir('static', install_dir: 'share/www', strip_directory: true, follow_symlinks: true)

# Config subdirectory

subdir('config')
bmcweb_dependencies += conf_h_dep

# Source files
fs = import('fs')

srcfiles_bmcweb = files(
    # end large files

    'redfish-core/src/error_messages.cpp',
    # Begin large files, should be at the beginning
    'redfish-core/src/redfish.cpp',
    'redfish-core/src/registries.cpp',
    'redfish-core/src/utils/dbus_utils.cpp',
    'redfish-core/src/utils/json_utils.cpp',
    'redfish-core/src/utils/time_utils.cpp',
    'src/boost_asio.cpp',
    'src/boost_asio_ssl.cpp',
    'src/boost_beast.cpp',
    'src/dbus_singleton.cpp',
    'src/json_html_serializer.cpp',
    'src/ossl_random.cpp',
    'src/webserver_run.cpp',
)

bmcweblib = static_library(
    'bmcweblib',
    srcfiles_bmcweb,
    include_directories: incdir,
    dependencies: bmcweb_dependencies,
)

# Generate the bmcweb executable
executable(
    'bmcweb',
    'src/webserver_main.cpp',
    include_directories: incdir,
    dependencies: bmcweb_dependencies,
    link_with: bmcweblib,
    link_args: '-Wl,--gc-sections',
    install: true,
    install_dir: bindir,
)

srcfiles_unittest = files(
    'test/http/crow_getroutes_test.cpp',
    'test/http/http2_connection_test.cpp',
    'test/http/http_body_test.cpp',
    'test/http/http_connection_test.cpp',
    'test/http/http_response_test.cpp',
    'test/http/mutual_tls.cpp',
    'test/http/mutual_tls_meta.cpp',
    'test/http/parsing_test.cpp',
    'test/http/router_test.cpp',
    'test/http/server_sent_event_test.cpp',
    'test/http/utility_test.cpp',
    'test/http/verb_test.cpp',
    'test/include/async_resolve_test.cpp',
    'test/include/credential_pipe_test.cpp',
    'test/include/dbus_utility_test.cpp',
    'test/include/google/google_service_root_test.cpp',
    'test/include/http_utility_test.cpp',
    'test/include/human_sort_test.cpp',
    'test/include/ibm/configfile_test.cpp',
    'test/include/json_html_serializer.cpp',
    'test/include/multipart_test.cpp',
    'test/include/openbmc_dbus_rest_test.cpp',
    'test/include/ossl_random.cpp',
    'test/include/ssl_key_handler_test.cpp',
    'test/include/str_utility_test.cpp',
    'test/redfish-core/include/privileges_test.cpp',
    'test/redfish-core/include/redfish_aggregator_test.cpp',
    'test/redfish-core/include/registries_test.cpp',
    'test/redfish-core/include/utils/dbus_utils.cpp',
    'test/redfish-core/include/utils/hex_utils_test.cpp',
    'test/redfish-core/include/utils/ip_utils_test.cpp',
    'test/redfish-core/include/utils/json_utils_test.cpp',
    'test/redfish-core/include/utils/query_param_test.cpp',
    'test/redfish-core/include/utils/stl_utils_test.cpp',
    'test/redfish-core/include/utils/time_utils_test.cpp',
    'test/redfish-core/lib/chassis_test.cpp',
    'test/redfish-core/lib/log_services_dump_test.cpp',
    'test/redfish-core/lib/log_services_test.cpp',
    'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
    'test/redfish-core/lib/metadata_test.cpp',
    'test/redfish-core/lib/power_subsystem_test.cpp',
    'test/redfish-core/lib/sensors_test.cpp',
    'test/redfish-core/lib/service_root_test.cpp',
    'test/redfish-core/lib/system_test.cpp',
    'test/redfish-core/lib/thermal_subsystem_test.cpp',
    'test/redfish-core/lib/update_service_test.cpp',
)

if (get_option('tests').allowed())
    # generate the test executable
    foreach test_src : srcfiles_unittest
        test_bin = executable(
            fs.stem(test_src),
            test_src,
            link_with: bmcweblib,
            include_directories: incdir,
            install_dir: bindir,
            dependencies: bmcweb_dependencies
            + [
                gtest,
                gmock,
            ],
        )
        test(fs.stem(test_src), test_bin)
    endforeach
endif
