Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 1 | fmt_dep = dependency('fmt', required: false) |
| 2 | if 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') |
| 14 | endif |
| 15 | |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 16 | bios_bmc_smm_error_logger_pre = declare_dependency( |
Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 17 | include_directories: [root_inc, bios_bmc_smm_error_logger_inc], |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 18 | dependencies: [ |
Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 19 | fmt_dep, |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 20 | dependency('threads'), |
Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 21 | dependency('stdplus'), |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 22 | ]) |
| 23 | |
Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 24 | bios_bmc_smm_error_logger_lib = static_library( |
| 25 | 'bios_bmc_smm_error_logger', |
| 26 | 'pci_handler.cpp', |
Brandon Kim | fcbc3db | 2022-06-06 21:26:18 -0700 | [diff] [blame] | 27 | 'buffer.cpp', |
Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 28 | implicit_include_directories: false, |
| 29 | dependencies: bios_bmc_smm_error_logger_pre) |
| 30 | |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 31 | bios_bmc_smm_error_logger_dep = declare_dependency( |
Brandon Kim | 55dcada | 2022-03-09 02:18:01 -0800 | [diff] [blame] | 32 | link_with: bios_bmc_smm_error_logger_lib, |
| 33 | dependencies: bios_bmc_smm_error_logger_pre) |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 34 | |
| 35 | executable( |
| 36 | 'bios-bmc-smm-error-logger', |
| 37 | 'main.cpp', |
Brandon Kim | 1a3dc60 | 2022-06-17 11:34:33 -0700 | [diff] [blame] | 38 | conf_h, |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 39 | implicit_include_directories: false, |
Brandon Kim | 1a3dc60 | 2022-06-17 11:34:33 -0700 | [diff] [blame] | 40 | dependencies: [bios_bmc_smm_error_logger_dep, rde_dep], |
Brandon Kim | 554fad0 | 2022-05-15 15:41:05 -0700 | [diff] [blame] | 41 | install: true, |
| 42 | install_dir: get_option('bindir') |
| 43 | ) |