summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build38
1 files changed, 38 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index b17ed18..7b751db 100644
--- a/meson.build
+++ b/meson.build
@@ -36,6 +36,8 @@ configure_file(input: 'src/config.h.in',
configuration : conf_data)
dbus_dep = dependency('sdbus-c++', version: '>= 2.0.0')
+md_dep = dependency('libmd', version: '>= 1.0.0', required: false)
+openssl_dep = dependency('openssl', version: '>= 1.0.0', required: false)
inc = include_directories('src')
@@ -203,6 +205,31 @@ base64_dep = declare_dependency(
link_with: base64_lib,
)
+if md_dep.found()
+ sha1_inner_source = 'src/sha1_md.cc'
+ sha1_inner_dep = md_dep
+elif openssl_dep.found()
+ sha1_inner_source = 'src/sha1_openssl.cc'
+ sha1_inner_dep = openssl_dep
+else
+ error('Need a library with SHA-1, either openssl or libmd')
+endif
+
+sha1_lib = library(
+ 'sha1',
+ sources: [
+ 'src/sha1.cc',
+ 'src/sha1.hh',
+ sha1_inner_source,
+ ],
+ include_directories: inc,
+ dependencies: [sha1_inner_dep],
+)
+sha1_dep = declare_dependency(
+ link_with: sha1_lib,
+ dependencies: [sha1_inner_dep],
+)
+
bluetooth_jukebox = executable(
'bluetooth-jukebox',
sources: [
@@ -355,6 +382,17 @@ test('base64', executable(
],
))
+test('sha1', executable(
+ 'test_sha1',
+ sources: ['test/sha1.cc'],
+ include_directories: inc,
+ dependencies : [
+ sha1_dep,
+ base64_dep,
+ test_dependencies,
+ ],
+))
+
run_clang_tidy = find_program('run-clang-tidy', required: false)
if run_clang_tidy.found()