add error if no db lib found, add better ci build and test

This commit is contained in:
2025-11-21 00:21:26 +01:00
parent b3cf8df094
commit e6b8985090
2 changed files with 21 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ labels:
platform: ${platform}
steps:
build-n-test:
build-berkeley:
when:
event: [push]
image: alpine:latest
@@ -15,3 +15,17 @@ steps:
- apk add --no-cache bash build-base words-en gdb perl pcre2 pcre2-dev db db-dev pkgconfig meson ninja
- meson setup --reconfigure build
- ninja -C build
- build/dbtool -d test.db -i -k "test" -v "blah blah blah"
- build/dbtool -d test.db -D | grep blah
build-gdbm:
when:
event: [push]
image: alpine:latest
commands:
- apk update
- apk add --no-cache bash build-base words-en gdb perl pcre2 pcre2-dev gdbm gdbm-dev pkgconfig meson ninja
- meson setup --reconfigure build
- ninja -C build
- build/dbtool -d test.db -i -k "test" -v "blah blah blah"
- build/dbtool -d test.db -D | grep blah

View File

@@ -46,15 +46,19 @@ pcre2 = dependency('libpcre2-8')
# manually check for libraries
lib_berkeley = cpp.find_library('db_cxx',
lib_berkeley = cpp.find_library('db_cxx', required: false,
dirs : ['/usr', '/usr/local'])
inc_berkeley = include_directories('/usr', '/usr/local')
lib_gdbm = cpp.find_library('gdbm',
lib_gdbm = cpp.find_library('gdbm', required: false,
dirs : ['/usr', '/usr/local'])
inc_gdbm = include_directories('/usr', '/usr/local')
if not lib_gdbm.found() and not lib_berkeley.found()
error('neither GDBM nor BerkeleyDB are installed')
endif
# check commandline options
prefix = get_option('prefix')