blob: 8e5a8ffd092884bd1ff62649c89f191a700a767c [file] [log] [blame]
Brandon Kim55dcada2022-03-09 02:18:01 -08001fmt_dep = dependency('fmt', required: false)
2if not fmt_dep.found()
3 fmt_opts = import('cmake').subproject_options()
4 fmt_opts.add_cmake_defines({
5 'CMAKE_POSITION_INDEPENDENT_CODE': 'ON',
6 'MASTER_PROJECT': 'OFF',
7 })
8 fmt_proj = import('cmake').subproject(
9 'fmt',
10 options: fmt_opts,
11 required: false)
12 assert(fmt_proj.found(), 'fmtlib is required')
13 fmt_dep = fmt_proj.dependency('fmt')
14endif
15
Brandon Kim554fad02022-05-15 15:41:05 -070016bios_bmc_smm_error_logger_pre = declare_dependency(
Brandon Kim55dcada2022-03-09 02:18:01 -080017 include_directories: [root_inc, bios_bmc_smm_error_logger_inc],
Brandon Kim554fad02022-05-15 15:41:05 -070018 dependencies: [
Brandon Kim55dcada2022-03-09 02:18:01 -080019 fmt_dep,
Brandon Kim554fad02022-05-15 15:41:05 -070020 dependency('threads'),
Brandon Kim55dcada2022-03-09 02:18:01 -080021 dependency('stdplus'),
Brandon Kim554fad02022-05-15 15:41:05 -070022 ])
23
Brandon Kim55dcada2022-03-09 02:18:01 -080024bios_bmc_smm_error_logger_lib = static_library(
25 'bios_bmc_smm_error_logger',
26 'pci_handler.cpp',
Brandon Kimfcbc3db2022-06-06 21:26:18 -070027 'buffer.cpp',
Brandon Kim55dcada2022-03-09 02:18:01 -080028 implicit_include_directories: false,
29 dependencies: bios_bmc_smm_error_logger_pre)
30
Brandon Kim554fad02022-05-15 15:41:05 -070031bios_bmc_smm_error_logger_dep = declare_dependency(
Brandon Kim55dcada2022-03-09 02:18:01 -080032 link_with: bios_bmc_smm_error_logger_lib,
33 dependencies: bios_bmc_smm_error_logger_pre)
Brandon Kim554fad02022-05-15 15:41:05 -070034
35executable(
36 'bios-bmc-smm-error-logger',
37 'main.cpp',
Brandon Kim1a3dc602022-06-17 11:34:33 -070038 conf_h,
Brandon Kim554fad02022-05-15 15:41:05 -070039 implicit_include_directories: false,
Brandon Kim1a3dc602022-06-17 11:34:33 -070040 dependencies: [bios_bmc_smm_error_logger_dep, rde_dep],
Brandon Kim554fad02022-05-15 15:41:05 -070041 install: true,
42 install_dir: get_option('bindir')
43)