lmdb: Build lmdb-safe as own CMake project/library

This commit is contained in:
Martchus 2022-01-30 01:28:03 +01:00
parent fa2ba49915
commit ecf25ca260
3 changed files with 10 additions and 11 deletions

2
3rdparty/lmdb-safe vendored

@ -1 +1 @@
Subproject commit adcb9338e8f80ede6a7cfe863eaf61e37849f2c0 Subproject commit ff1fc3ebd4568cbff31309d66e125ef5e3d55f3b

View File

@ -22,6 +22,10 @@ option(INCLUDE_TABULATE_PROJECT "includes the CMake project of tabulate" OFF)
if (INCLUDE_TABULATE_PROJECT) if (INCLUDE_TABULATE_PROJECT)
add_subdirectory(3rdparty/tabulate) add_subdirectory(3rdparty/tabulate)
endif () endif ()
option(INCLUDE_LMDB_SAFE_PROJECT "includes the CMake project of lmdb-safe" ON)
if (INCLUDE_LMDB_SAFE_PROJECT)
add_subdirectory(3rdparty/lmdb-safe)
endif ()
add_subdirectory(libpkg) add_subdirectory(libpkg)
link_directories(${LIBPKG_BINARY_DIR}) link_directories(${LIBPKG_BINARY_DIR})
add_subdirectory(librepomgr) add_subdirectory(librepomgr)

View File

@ -30,12 +30,7 @@ set(SRC_FILES
parser/config.cpp parser/config.cpp
parser/utils.cpp parser/utils.cpp
parser/binary.cpp parser/binary.cpp
parser/siglevel.cpp parser/siglevel.cpp)
lmdb-safe/lmdb-safe.hh
lmdb-safe/lmdb-typed.hh
lmdb-safe/lmdb-reflective.hh
lmdb-safe/lmdb-safe.cc
lmdb-safe/lmdb-typed.cc)
set(TEST_HEADER_FILES tests/parser_helper.h) set(TEST_HEADER_FILES tests/parser_helper.h)
set(TEST_SRC_FILES tests/cppunit.cpp tests/parser.cpp tests/parser_binary.cpp tests/parser_helper.cpp tests/data.cpp set(TEST_SRC_FILES tests/cppunit.cpp tests/parser.cpp tests/parser_binary.cpp tests/parser_helper.cpp tests/data.cpp
tests/utils.cpp) tests/utils.cpp)
@ -49,7 +44,6 @@ set(META_APP_DESCRIPTION "C++ library to parse Arch Linux packages and databases
set(META_VERSION_MAJOR 0) set(META_VERSION_MAJOR 0)
set(META_VERSION_MINOR 0) set(META_VERSION_MINOR 0)
set(META_VERSION_PATCH 1) set(META_VERSION_PATCH 1)
set(META_TIDY_EXCLUDE_REGEX "lmdb-safe/.*")
# find c++utilities # find c++utilities
set(CONFIGURATION_PACKAGE_SUFFIX set(CONFIGURATION_PACKAGE_SUFFIX
@ -66,8 +60,9 @@ use_standard_filesystem(VISIBILITY PUBLIC)
find_package(reflective_rapidjson${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED) find_package(reflective_rapidjson${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED)
use_reflective_rapidjson(VISIBILITY PUBLIC) use_reflective_rapidjson(VISIBILITY PUBLIC)
# find lmdb # find lmdb-safe
use_pkg_config_module(PKG_CONFIG_MODULES "lmdb") find_package(lmdb-safe${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED)
use_lmdb_safe()
# find 3rd party libraries zlib # find 3rd party libraries zlib
use_zlib() use_zlib()
@ -81,7 +76,7 @@ set_property(TARGET libarchive PROPERTY IMPORTED_LOCATION "${LibArchive_LIBRARIE
set_property(TARGET libarchive PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${LibArchive_INCLUDE_DIRS}") set_property(TARGET libarchive PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${LibArchive_INCLUDE_DIRS}")
use_target(TARGET_NAME libarchive) use_target(TARGET_NAME libarchive)
# find boost libraries (required by lmdb-safe) # find boost libraries (required by lmdb-safe's integration with reflective-rapidjson)
option(BOOST_STATIC_LINKAGE "${STATIC_LINKAGE}" "link statically against Boost (instead of dynamically)") option(BOOST_STATIC_LINKAGE "${STATIC_LINKAGE}" "link statically against Boost (instead of dynamically)")
set(Boost_USE_MULTITHREADED ON) set(Boost_USE_MULTITHREADED ON)
if (BOOST_STATIC_LINKAGE) if (BOOST_STATIC_LINKAGE)