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 | |
John Wedig | 67a4744 | 2022-04-05 17:21:29 -0700 | [diff] [blame] | 13 | boost_dep = dependency('boost',version : '>=1.78.0', required : false, include_type: 'system') |
| 14 | if not boost_dep.found() |
| 15 | subproject('boost', required: false) |
| 16 | boost_inc = include_directories('subprojects/boost_1_78_0/', is_system:true) |
| 17 | boost = declare_dependency(include_directories : boost_inc) |
| 18 | boost = boost.as_system('system') |
| 19 | endif |
| 20 | |
John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame] | 21 | subdir('erase') |
| 22 | |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 23 | libeStoraged_deps = [ |
John Wedig | b810c92 | 2021-11-17 16:38:03 -0800 | [diff] [blame] | 24 | dependency('libcryptsetup'), |
Patrick Williams | 0c2808f | 2022-02-25 09:35:14 -0600 | [diff] [blame] | 25 | dependency('openssl'), |
| 26 | phosphor_dbus_interfaces_dep, |
| 27 | phosphor_logging_dep, |
| 28 | sdbusplus_dep, |
| 29 | stdplus_dep, |
John Wedig | 67a4744 | 2022-04-05 17:21:29 -0700 | [diff] [blame] | 30 | boost_dep, |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 31 | ] |
| 32 | |
| 33 | libeStoraged_lib = static_library( |
| 34 | 'eStoraged-lib', |
| 35 | 'estoraged.cpp', |
John Edward Broadbent | a6e3b99 | 2022-03-17 14:33:15 -0700 | [diff] [blame] | 36 | 'util.cpp', |
John Wedig | d32b966 | 2022-04-13 18:12:25 -0700 | [diff] [blame] | 37 | 'getConfig.cpp', |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 38 | include_directories : eStoraged_headers, |
| 39 | implicit_include_directories: false, |
John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame] | 40 | dependencies: [libeStoraged_deps, libeStoragedErase_dep], |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 41 | ) |
| 42 | |
| 43 | libeStoraged = declare_dependency( |
| 44 | dependencies: libeStoraged_deps, |
| 45 | include_directories: eStoraged_headers, |
John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame] | 46 | link_with: libeStoraged_lib, |
| 47 | ) |
John Wedig | 2098dab | 2021-09-14 13:56:28 -0700 | [diff] [blame] | 48 | |
| 49 | executable( |
| 50 | 'eStoraged', |
| 51 | 'main.cpp', |
| 52 | implicit_include_directories: false, |
| 53 | dependencies: libeStoraged, |
| 54 | install: true, |
| 55 | install_dir: get_option('bindir') |
| 56 | ) |
John Wedig | b810c92 | 2021-11-17 16:38:03 -0800 | [diff] [blame] | 57 | |
| 58 | build_tests = get_option('tests') |
| 59 | if not build_tests.disabled() |
| 60 | subdir('test') |
| 61 | endif |
| 62 | |