# See README.md for details.
project('openpower-hw-diags', 'cpp',
        version: '0.1', meson_version: '>=1.1.1',
        default_options: [
          'warning_level=3',
          'werror=true',
          'cpp_std=c++23',
        ])

# Package directory root, which will contain required data files.
package_dir = join_paths( get_option('prefix'),
                          get_option('datadir'),
                          meson.project_name() )

# Compiler option so that source knows the package directory.
package_args = [ '-DPACKAGE_DIR="' + package_dir + '/"' ]

#-------------------------------------------------------------------------------
# Versioning
#-------------------------------------------------------------------------------
buildinfo = vcs_tag(command: ['git', 'describe', '--always', '--long'],
                  input: 'buildinfo.hpp.in',
                  output: 'buildinfo.hpp',
                  replace_string:'@BUILDINFO@',
                  fallback: '0')

#-------------------------------------------------------------------------------
# Compiler
#-------------------------------------------------------------------------------

cmplr = meson.get_compiler('cpp')

#-------------------------------------------------------------------------------
# Config file
#-------------------------------------------------------------------------------

conf = configuration_data()

conf.set('CONFIG_PHAL_API', get_option('phal').allowed())

configure_file(input: 'config.h.in', output: 'config.h', configuration: conf)

#-------------------------------------------------------------------------------
# Include directories
#-------------------------------------------------------------------------------

# Only using the base directory. All header includes should provide the full
# path from the base directory.
incdir = include_directories('.')

#-------------------------------------------------------------------------------
# External library dependencies
#-------------------------------------------------------------------------------

# Look if the libhei library has already been built and installed. If not,
# default to the subproject.
libhei_dep = dependency('hei', fallback : ['libhei', 'libhei_dep'])

phosphor_logging_dep = dependency('phosphor-logging',
    fallback: ['phosphor-logging', 'phosphor_logging_dep'])

sdbusplus_dep       = dependency('sdbusplus', version : '>=1.0')
dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')

libpdbg_dep = cmplr.find_library('pdbg')

if get_option('phal').allowed()
  libphal_dep = cmplr.find_library('phal')
endif

libpldm_dep = dependency('libpldm')

pthread = declare_dependency(link_args : '-pthread')
lrt = declare_dependency(link_args : '-lrt')

# JSON parser
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')

# JSON validator
if cmplr.has_header('valijson/validator.hpp')
    valijson_dep = declare_dependency()
else
    subproject('valijson', required: false)
    valijson_dep = declare_dependency(
        include_directories: 'subprojects/valijson/include'
    )
    valijson_dep = valijson_dep.as_system('system')
endif

#-------------------------------------------------------------------------------
# Build the local static libraries
#-------------------------------------------------------------------------------

subdir('analyzer')
subdir('attn')
subdir('util')

hwdiags_libs = [
    analyzer_lib,
    attn_lib,
    util_lib,
]

#-------------------------------------------------------------------------------
# Build the executable
#-------------------------------------------------------------------------------

no_listener_mode = get_option('nlmode')

if not no_listener_mode.disabled()
  executable('openpower-hw-diags',
              sources : [ 'main_nl.cpp', 'cli.cpp', buildinfo, plugins_src ],
              dependencies : [ libhei_dep ],
              link_with : hwdiags_libs,
              install : true)
else
  executable('openpower-hw-diags',
              sources : [ 'main.cpp', 'cli.cpp', 'listener.cpp', buildinfo,
                          plugins_src ],
              dependencies : [lrt, pthread, libhei_dep],
              link_with : hwdiags_libs,
              install : true)
endif

#-------------------------------------------------------------------------------
# Test, if configured
#-------------------------------------------------------------------------------

build_tests = get_option('tests')

if not build_tests.disabled()

  # IMPORTANT NOTE:
  # We cannot link the test executables to `util_lib` because:
  #   - It is built without `-DTEST_TRACE` and any of the util functions that
  #     use `trace.hpp` will throw a linker error because we don't have access
  #     to phosphor-logging in test ... yet. This issue will go away once we
  #     have converted all of our trace to use the `lg2` interfaces.
  #   - Some functions related to pdbg and dbus simply cannot be built in the
  #     test environment. Instead, there are alternate implementation of those
  #     functions to simulate them for testing (see `test/*-sim-only.cpp`).
  # Instead we will build a `test_util_lib` that will contain the `util` files
  # that we need in test along with simulated versions of some util functions.

  # IMPORTANT NOTE:
  # When running GCOV reports, the Jenkins CI script explicitly ignores any
  # libraries and executables built in the `test/` directory. Therefore, this
  # `test_util_lib` library must be built here instead in order to get any GCOV
  # credit for the code.

  test_args = [
    '-DTEST_TRACE',
    package_args,
  ]

  test_util_srcs = [
    files(
      'util/data_file.cpp',
      'util/ffdc_file.cpp',
      'util/pdbg.cpp',
      'util/temporary_file.cpp',
      'test/dbus-sim-only.cpp',
      'test/pdbg-sim-only.cpp',
    ),
  ]

  test_util_deps = [
    libhei_dep,
    libpdbg_dep,
    phosphor_logging_dep,
  ]

  test_util_lib = static_library('test_util_lib',
    sources             : test_util_srcs,
    include_directories : incdir,
    dependencies        : test_util_deps,
    cpp_args            : test_args,
    install             : true,
  )

  test_libs = [
    analyzer_lib,
    attn_lib,
    test_util_lib,
  ]

  subdir('test')
endif
