Skip to content

Commit 23b48c4

Browse files
committed
Conditional compilation
1 parent 75e1d0e commit 23b48c4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/ifcparse/IfcFile.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#include "IfcFile.h"
22
#include "IfcLogger.h"
33

4+
#ifdef IFOPSH_WITH_ROCKSDB
45
#include <rocksdb/table.h>
56
#include <rocksdb/convenience.h>
7+
#endif
68

79
IfcParse::parse_context::~parse_context() {
810
for (auto& t : tokens_) {
@@ -462,7 +464,9 @@ IfcParse::impl::rocks_db_file_storage::rocks_db_file_storage(const std::string&
462464
// @todo by_identity is probably not correct here, this mapping is Name -> Identity, so Fn should have access to full pair?
463465
// , byidentity_(&byid_, [this](size_t v) { return assert_existance(v, by_identity); }, [](IfcUtil::IfcBaseClass* v) { return v->identity(); })
464466
{
467+
#ifdef IFOPSH_WITH_ROCKSDB
465468
wopts.disableWAL = true;
469+
#endif
466470
}
467471

468472
IfcParse::impl::rocks_db_file_storage::~rocks_db_file_storage()

src/ifcparse/IfcParse.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2529,6 +2529,7 @@ std::vector<int> IfcFile::get_inverse_indices(int instance_id) {
25292529
}
25302530
}
25312531
} else if constexpr (std::is_same_v<std::decay_t<decltype(x)>, impl::rocks_db_file_storage>) {
2532+
#ifdef IFOPSH_WITH_ROCKSDB
25322533
// @todo no lower/upper_bounds() implemented yet
25332534
auto prefix = "v|" + std::to_string(instance_id) + "|";
25342535
auto it = std::unique_ptr<rocksdb::Iterator>(x.db->NewIterator(rocksdb::ReadOptions()));
@@ -2542,7 +2543,7 @@ std::vector<int> IfcFile::get_inverse_indices(int instance_id) {
25422543
}
25432544
it->Next();
25442545
}
2545-
2546+
#endif
25462547
}
25472548
}, storage_);
25482549

0 commit comments

Comments
 (0)