Gav Wood
10 years ago
26 changed files with 136 additions and 77 deletions
@ -0,0 +1,49 @@ |
|||||
|
# Find rocksdb |
||||
|
# |
||||
|
# Find the rocksdb includes and library |
||||
|
# |
||||
|
# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH |
||||
|
# |
||||
|
# This module defines |
||||
|
# ROCKSDB_INCLUDE_DIRS, where to find header, etc. |
||||
|
# ROCKSDB_LIBRARIES, the libraries needed to use rocksdb. |
||||
|
# ROCKSDB_FOUND, If false, do not try to use rocksdb. |
||||
|
|
||||
|
# only look in default directories |
||||
|
find_path( |
||||
|
ROCKSDB_INCLUDE_DIR |
||||
|
NAMES rocksdb/db.h |
||||
|
DOC "rocksdb include dir" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
ROCKSDB_LIBRARY |
||||
|
NAMES rocksdb |
||||
|
DOC "rocksdb library" |
||||
|
) |
||||
|
|
||||
|
set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR}) |
||||
|
set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) |
||||
|
|
||||
|
# debug library on windows |
||||
|
# same naming convention as in qt (appending debug library with d) |
||||
|
# boost is using the same "hack" as us with "optimized" and "debug" |
||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") |
||||
|
|
||||
|
find_library( |
||||
|
ROCKSDB_LIBRARY_DEBUG |
||||
|
NAMES rocksdbd |
||||
|
DOC "rocksdb debug library" |
||||
|
) |
||||
|
|
||||
|
set(ROCKSDB_LIBRARIES optimized ${ROCKSDB_LIBRARIES} debug ${ROCKSDB_LIBRARY_DEBUG}) |
||||
|
|
||||
|
endif() |
||||
|
|
||||
|
# handle the QUIETLY and REQUIRED arguments and set ROCKSDB_FOUND to TRUE |
||||
|
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(rocksdb DEFAULT_MSG |
||||
|
ROCKSDB_INCLUDE_DIR ROCKSDB_LIBRARY) |
||||
|
mark_as_advanced (ROCKSDB_INCLUDE_DIR ROCKSDB_LIBRARY) |
||||
|
|
@ -0,0 +1,36 @@ |
|||||
|
/*
|
||||
|
This file is part of cpp-ethereum. |
||||
|
|
||||
|
cpp-ethereum is free software: you can redistribute it and/or modify |
||||
|
it under the terms of the GNU General Public License as published by |
||||
|
the Free Software Foundation, either version 3 of the License, or |
||||
|
(at your option) any later version. |
||||
|
|
||||
|
cpp-ethereum is distributed in the hope that it will be useful, |
||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
GNU General Public License for more details. |
||||
|
|
||||
|
You should have received a copy of the GNU General Public License |
||||
|
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
/** @file DB.h
|
||||
|
* @author Gav Wood <i@gavwood.com> |
||||
|
* @date 2014 |
||||
|
*/ |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#pragma warning(push) |
||||
|
#pragma warning(disable: 4100 4267) |
||||
|
#if ETH_ROCKSDB || !ETH_TRUE |
||||
|
#include <rocksdb/db.h> |
||||
|
#include <rocksdb/write_batch.h> |
||||
|
namespace ldb = rocksdb; |
||||
|
#else |
||||
|
#include <leveldb/db.h> |
||||
|
#include <leveldb/write_batch.h> |
||||
|
namespace ldb = leveldb; |
||||
|
#endif |
||||
|
#pragma warning(pop) |
||||
|
#define DEV_LDB 1 |
Loading…
Reference in new issue