blob: e34838c24fb235b4b4a79c74e3a2edd81b5ad18c [file] [log] [blame]
Patrick Williams0c2808f2022-02-25 09:35:14 -06001phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
2phosphor_logging_dep = dependency('phosphor-logging')
John Wedig67a47442022-04-05 17:21:29 -07003
4sdbusplus_dep = dependency('sdbusplus', required: false, include_type: 'system')
5if 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')
9endif
10
Patrick Williams0c2808f2022-02-25 09:35:14 -060011stdplus_dep = dependency('stdplus')
John Wedig2098dab2021-09-14 13:56:28 -070012
John Wedig67a47442022-04-05 17:21:29 -070013boost_dep = dependency('boost',version : '>=1.78.0', required : false, include_type: 'system')
14if 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')
19endif
20
John Edward Broadbente6ffe702021-10-14 14:03:11 -070021subdir('erase')
22
John Wedig2098dab2021-09-14 13:56:28 -070023libeStoraged_deps = [
John Wedigb810c922021-11-17 16:38:03 -080024 dependency('libcryptsetup'),
Patrick Williams0c2808f2022-02-25 09:35:14 -060025 dependency('openssl'),
26 phosphor_dbus_interfaces_dep,
27 phosphor_logging_dep,
28 sdbusplus_dep,
29 stdplus_dep,
John Wedig67a47442022-04-05 17:21:29 -070030 boost_dep,
John Wedig2098dab2021-09-14 13:56:28 -070031]
32
33libeStoraged_lib = static_library(
34 'eStoraged-lib',
35 'estoraged.cpp',
John Edward Broadbenta6e3b992022-03-17 14:33:15 -070036 'util.cpp',
John Wedigd32b9662022-04-13 18:12:25 -070037 'getConfig.cpp',
John Wedig2098dab2021-09-14 13:56:28 -070038 include_directories : eStoraged_headers,
39 implicit_include_directories: false,
John Edward Broadbente6ffe702021-10-14 14:03:11 -070040 dependencies: [libeStoraged_deps, libeStoragedErase_dep],
John Wedig2098dab2021-09-14 13:56:28 -070041)
42
43libeStoraged = declare_dependency(
44 dependencies: libeStoraged_deps,
45 include_directories: eStoraged_headers,
John Edward Broadbente6ffe702021-10-14 14:03:11 -070046 link_with: libeStoraged_lib,
47)
John Wedig2098dab2021-09-14 13:56:28 -070048
49executable(
50 'eStoraged',
51 'main.cpp',
52 implicit_include_directories: false,
53 dependencies: libeStoraged,
54 install: true,
55 install_dir: get_option('bindir')
56)
John Wedigb810c922021-11-17 16:38:03 -080057
58build_tests = get_option('tests')
59if not build_tests.disabled()
60 subdir('test')
61endif
62