mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 21:06:25 +00:00
Support RocksDB shared library and new unique_ptr DB::Open API
Some distributions (e.g. Fedora) ship only a shared RocksDB that exports RocksDB::rocksdb-shared rather than RocksDB::rocksdb. The CMake target selection now falls back to the shared target when the static one is absent. Newer RocksDB also changed DB::Open and DB::OpenForReadOnly to take std::unique_ptr<DB>* instead of DB**. IfcFile.cpp uses SFINAE tag dispatch to build against both old and new APIs without version detection.
This commit is contained in:
committed by
Thomas Krijnen
parent
5f7d9b86b8
commit
818ca6b2bc
@@ -259,6 +259,14 @@ if (WITH_ROCKSDB)
|
||||
endif()
|
||||
|
||||
message(STATUS "RocksDB: found at '${RocksDB_DIR}'.")
|
||||
# See https://github.com/facebook/rocksdb/issues/981.
|
||||
if(TARGET RocksDB::rocksdb)
|
||||
set(IFCOPENSHELL_ROCKSDB_TARGET RocksDB::rocksdb)
|
||||
elseif(TARGET RocksDB::rocksdb-shared)
|
||||
set(IFCOPENSHELL_ROCKSDB_TARGET RocksDB::rocksdb-shared)
|
||||
else()
|
||||
message(FATAL_ERROR "RocksDB found but neither RocksDB::rocksdb nor RocksDB::rocksdb-shared target exists")
|
||||
endif()
|
||||
|
||||
if (WITH_ZSTD)
|
||||
# @todo do we actually need the zstd include dir or rather just pass
|
||||
|
||||
Reference in New Issue
Block a user