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)

# 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/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/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
