firmware_inc = include_directories('.')

# phosphor-ipmi-flash config
config_data = []
if get_option('update-type') == 'static-layout'
  if get_option('reboot-update')
    config_data += 'config-static-bmc-reboot.json'
  else
    if get_option('update-status')
      config_data += 'config-static-bmc-with-update-status.json'
    else
      config_data += 'config-static-bmc.json'
    endif
  endif
endif

if get_option('host-bios')
  config_data += 'config-bios.json'
endif

foreach data : config_data
  configure_file(
    input: data + '.in',
    output: data,
    configuration: conf_data,
    install: true,
    install_dir: get_option('datadir') / 'phosphor-ipmi-flash')
endforeach

# temp files
install_data(
  'phosphor-ipmi-flash.conf',
  install_dir: get_option('libdir') / 'tmpfiles.d')

# systemd configs
systemd_data = [
  'phosphor-ipmi-flash-bmc-prepare.target',
  'phosphor-ipmi-flash-bmc-verify.target',
  'phosphor-ipmi-flash-bmc-update.target',
]

if get_option('host-bios')
  systemd_data += [
    'phosphor-ipmi-flash-bios-prepare.target',
    'phosphor-ipmi-flash-bios-verify.target',
    'phosphor-ipmi-flash-bios-update.target']
endif

systemd = dependency('systemd')
if systemd.found()
  foreach data : systemd_data
    configure_file(
      input: data + '.in',
      output: data,
      configuration: conf_data,
      install: true,
      install_dir: systemd.get_variable('systemdsystemunitdir'))
  endforeach
endif

firmware_source = [
  'firmware_handlers_builder.cpp',
  'firmware_handler.cpp',
  'lpc_handler.cpp']

if (get_option('lpc-type') == 'aspeed-lpc' or
    not get_option('tests').disabled())
  firmware_source += 'lpc_aspeed.cpp'
endif

if (get_option('lpc-type') == 'nuvoton-lpc' or
    not get_option('tests').disabled())
  firmware_source += 'lpc_nuvoton.cpp'
endif

if (get_option('p2a-type') == 'aspeed-p2a' or
    not get_option('tests').disabled())
  firmware_source += 'pci_handler.cpp'
endif

if get_option('p2a-type') == 'nuvoton-p2a-vga'
  firmware_source += 'pci_nuvoton_handler.cpp'
endif

if get_option('p2a-type') == 'nuvoton-p2a-mbox'
  firmware_source += 'pci_nuvoton_handler.cpp'
endif

if get_option('net-bridge')
  firmware_source += 'net_handler.cpp'
endif

firmware_pre = declare_dependency(
  include_directories: [root_inc, bmc_inc, firmware_inc],
  dependencies: [
    dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
    common_dep,
    blobs_dep,
    sys_dep,
  ])

firmware_lib = static_library(
  'firmwareblob',
  firmware_source,
  conf_h,
  implicit_include_directories: false,
  dependencies: firmware_pre)

firmware_dep = declare_dependency(
  link_with: firmware_lib,
  dependencies: firmware_pre)

shared_module(
  'firmwareblob',
  'main.cpp',
  implicit_include_directories: false,
  dependencies: [
    firmware_dep,
    dependency('libipmid'),
  ],
  install: true,
  install_dir: get_option('libdir') / 'blob-ipmid')

if not get_option('tests').disabled()
  subdir('test')
endif
