Patrick Williams | 0c2808f | 2022-02-25 09:35:14 -0600 | [diff] [blame] | 1 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 2 | phosphor_logging_dep = dependency('phosphor-logging') |
John Wedig | 67a4744 | 2022-04-05 17:21:29 -0700 | [diff] [blame] | 3 | |
| 4 | sdbusplus_dep = dependency('sdbusplus', required: false, include_type: 'system') |
| 5 | if not sdbusplus_dep.found() |
| 6 | sdbusplus_proj = subproject('sdbusplus', required: true) |
| 7 | sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep') |
| 8 | sdbusplus = sdbusplus.as_system('system') |
| 9 | endif |
| 10 | |
Patrick Williams | 0c2808f | 2022-02-25 09:35:14 -0600 | [diff] [blame] | 11 | stdplus_dep = dependency('stdplus') |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 12 | |
Konstantin Aladyshev | 620d1a5 | 2024-03-29 18:16:17 +0300 | [diff] [blame] | 13 | boost_dep = dependency('boost',version : '>=1.78.0', include_type: 'system') |
John Wedig | 67a4744 | 2022-04-05 17:21:29 -0700 | [diff] [blame] | 14 | |
John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame] | 15 | subdir('erase') |
| 16 | |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 17 | libeStoraged_deps = [ |
John Wedig | b810c92 | 2021-11-17 16:38:03 -0800 | [diff] [blame] | 18 | dependency('libcryptsetup'), |
Patrick Williams | 0c2808f | 2022-02-25 09:35:14 -0600 | [diff] [blame] | 19 | dependency('openssl'), |
| 20 | phosphor_dbus_interfaces_dep, |
| 21 | phosphor_logging_dep, |
| 22 | sdbusplus_dep, |
| 23 | stdplus_dep, |
John Wedig | 67a4744 | 2022-04-05 17:21:29 -0700 | [diff] [blame] | 24 | boost_dep, |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 25 | ] |
| 26 | |
| 27 | libeStoraged_lib = static_library( |
| 28 | 'eStoraged-lib', |
| 29 | 'estoraged.cpp', |
John Edward Broadbent | a6e3b99 | 2022-03-17 14:33:15 -0700 | [diff] [blame] | 30 | 'util.cpp', |
John Wedig | d32b966 | 2022-04-13 18:12:25 -0700 | [diff] [blame] | 31 | 'getConfig.cpp', |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 32 | include_directories : eStoraged_headers, |
| 33 | implicit_include_directories: false, |
John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame] | 34 | dependencies: [libeStoraged_deps, libeStoragedErase_dep], |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 35 | ) |
| 36 | |
| 37 | libeStoraged = declare_dependency( |
| 38 | dependencies: libeStoraged_deps, |
| 39 | include_directories: eStoraged_headers, |
John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame] | 40 | link_with: libeStoraged_lib, |
| 41 | ) |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 42 | |
| 43 | executable( |
| 44 | 'eStoraged', |
| 45 | 'main.cpp', |
| 46 | implicit_include_directories: false, |
| 47 | dependencies: libeStoraged, |
| 48 | install: true, |
| 49 | install_dir: get_option('bindir') |
| 50 | ) |
John Wedig | b810c92 | 2021-11-17 16:38:03 -0800 | [diff] [blame] | 51 | |
| 52 | build_tests = get_option('tests') |
George Liu | b650879 | 2023-08-07 17:26:36 +0800 | [diff] [blame] | 53 | if build_tests.allowed() |
John Wedig | b810c92 | 2021-11-17 16:38:03 -0800 | [diff] [blame] | 54 | subdir('test') |
| 55 | endif |
| 56 | |