nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | README | LICENSE

commit 90a664335a802304cb79ed4449dfdc095170e533
parent 9b9c271627552dd322da31626eb220297f781a95
Author: pvn <me@pedro-vicente.net>
Date:   Mon, 24 Jul 2023 17:49:13 -0400

Add a CMake script. Tested in Ubuntu Linux 22.04

Closes: https://github.com/damus-io/nostrdb/pull/1

Diffstat:
ACMakeLists.txt | 46++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+), 0 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -0,0 +1,46 @@ +# cmake -S . -B build +# cd build +# cmake --build . +# Pedro Vicente + +if (MSVC) + cmake_minimum_required(VERSION 3.26) +else() + cmake_minimum_required(VERSION 3.15) +endif() +set(CMAKE_BUILD_TYPE Debug) +project (nostrdb C) + +#////////////////////////// +# sources +#////////////////////////// + +set(src ${src}) +set(src ${src} nostrdb.c) +set(src ${src} nostrdb.h) +set(src ${src} cursor.h) +set(src ${src} hex.h) +set(src ${src} jsmn.h) + +add_library(libnostrdb ${src}) + +#////////////////////////// +# link with libraries +# lib_dep contains a cascade definition of all the libraries needed to link +#////////////////////////// + +set(lib_dep ${lib_dep}) +set(lib_dep ${lib_dep} libnostrdb) + +#////////////////////////// +# executables +#////////////////////////// + +add_executable(test test.c) +add_executable(bench bench.c) +target_link_libraries (test ${lib_dep}) +target_link_libraries (bench ${lib_dep}) + + + +