# 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()

# OpenPOWER dump object path override
conf.set_quoted('OP_DUMP_OBJ_PATH', get_option('op_dump_obj_path'))

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 = dependency('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
    valijson_dep = dependency('valijson', include_type: '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
