From ecf25ca260a597f11fd872ea50ed3213c086305a Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 30 Jan 2022 01:28:03 +0100 Subject: [PATCH] lmdb: Build lmdb-safe as own CMake project/library --- 3rdparty/lmdb-safe | 2 +- CMakeLists.txt | 4 ++++ libpkg/CMakeLists.txt | 15 +++++---------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/3rdparty/lmdb-safe b/3rdparty/lmdb-safe index adcb933..ff1fc3e 160000 --- a/3rdparty/lmdb-safe +++ b/3rdparty/lmdb-safe @@ -1 +1 @@ -Subproject commit adcb9338e8f80ede6a7cfe863eaf61e37849f2c0 +Subproject commit ff1fc3ebd4568cbff31309d66e125ef5e3d55f3b diff --git a/CMakeLists.txt b/CMakeLists.txt index cf64f89..14c9110 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ option(INCLUDE_TABULATE_PROJECT "includes the CMake project of tabulate" OFF) if (INCLUDE_TABULATE_PROJECT) add_subdirectory(3rdparty/tabulate) 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) link_directories(${LIBPKG_BINARY_DIR}) add_subdirectory(librepomgr) diff --git a/libpkg/CMakeLists.txt b/libpkg/CMakeLists.txt index 604deda..c963c83 100644 --- a/libpkg/CMakeLists.txt +++ b/libpkg/CMakeLists.txt @@ -30,12 +30,7 @@ set(SRC_FILES parser/config.cpp parser/utils.cpp parser/binary.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) + parser/siglevel.cpp) 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 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_MINOR 0) set(META_VERSION_PATCH 1) -set(META_TIDY_EXCLUDE_REGEX "lmdb-safe/.*") # find c++utilities set(CONFIGURATION_PACKAGE_SUFFIX @@ -66,8 +60,9 @@ use_standard_filesystem(VISIBILITY PUBLIC) find_package(reflective_rapidjson${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED) use_reflective_rapidjson(VISIBILITY PUBLIC) -# find lmdb -use_pkg_config_module(PKG_CONFIG_MODULES "lmdb") +# find lmdb-safe +find_package(lmdb-safe${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED) +use_lmdb_safe() # find 3rd party libraries 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}") 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)") set(Boost_USE_MULTITHREADED ON) if (BOOST_STATIC_LINKAGE)