Set NANO_ROCKSDB define even when set to OFF (#2313)

This commit is contained in:
Wesley Shillingford 2019-09-24 17:06:46 +01:00 committed by GitHub
commit b50c9d74f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 13 deletions

View file

@ -42,9 +42,8 @@ if (${NANO_TIMED_LOCKS} GREATER 0)
add_definitions (-DNANO_TIMED_LOCKS=${NANO_TIMED_LOCKS})
endif ()
if (NANO_ROCKSDB)
add_definitions (-DNANO_ROCKSDB=1)
endif ()
add_definitions (-DNANO_ROCKSDB=$<STREQUAL:${NANO_ROCKSDB},ON>)
option(NANO_ASAN_INT "Enable ASan+UBSan+Integer overflow" OFF)
option(NANO_ASAN "Enable ASan+UBSan" OFF)
option(NANO_TSAN "Enable TSan" OFF)

View file

@ -243,16 +243,19 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map
{
// Note that these throw on failure
std::cout << "Finalizing" << std::endl;
#ifdef NANO_ROCKSDB
nano::remove_all_files_in_dir (backup_path);
nano::move_all_files_to_dir (source_path, backup_path);
nano::move_all_files_to_dir (vacuum_path, source_path);
boost::filesystem::remove_all (vacuum_path);
#else
boost::filesystem::remove (backup_path);
boost::filesystem::rename (source_path, backup_path);
boost::filesystem::rename (vacuum_path, source_path);
#endif
if (using_rocksdb)
{
nano::remove_all_files_in_dir (backup_path);
nano::move_all_files_to_dir (source_path, backup_path);
nano::move_all_files_to_dir (vacuum_path, source_path);
boost::filesystem::remove_all (vacuum_path);
}
else
{
boost::filesystem::remove (backup_path);
boost::filesystem::rename (source_path, backup_path);
boost::filesystem::rename (vacuum_path, source_path);
}
std::cout << "Vacuum completed" << std::endl;
}
else