|
|
@ -84,7 +84,7 @@ check_cxx_compiler_flag(-Wthread-safety HAVE_CLANG_THREAD_SAFETY) |
|
|
|
|
|
|
|
# Used by googletest. |
|
|
|
check_cxx_compiler_flag(-Wno-missing-field-initializers |
|
|
|
LEVELDB_HAVE_NO_MISSING_FIELD_INITIALIZERS) |
|
|
|
LEVELDB_HAVE_NO_MISSING_FIELD_INITIALIZERS) |
|
|
|
|
|
|
|
include(CheckCXXSourceCompiles) |
|
|
|
|
|
|
@ -100,13 +100,13 @@ set(LEVELDB_PUBLIC_INCLUDE_DIR "include/leveldb") |
|
|
|
set(LEVELDB_PORT_CONFIG_DIR "include/port") |
|
|
|
|
|
|
|
configure_file( |
|
|
|
"port/port_config.h.in" |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"port/port_config.h.in" |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
) |
|
|
|
|
|
|
|
include_directories( |
|
|
|
"${PROJECT_BINARY_DIR}/include" |
|
|
|
"." |
|
|
|
"${PROJECT_BINARY_DIR}/include" |
|
|
|
"." |
|
|
|
) |
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS) |
|
|
@ -119,153 +119,153 @@ include(GNUInstallDirs) |
|
|
|
|
|
|
|
add_library(leveldb "") |
|
|
|
target_sources(leveldb |
|
|
|
PRIVATE |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"db/builder.cc" |
|
|
|
"db/builder.h" |
|
|
|
"db/c.cc" |
|
|
|
"db/db_impl.cc" |
|
|
|
"db/db_impl.h" |
|
|
|
"db/db_iter.cc" |
|
|
|
"db/db_iter.h" |
|
|
|
"db/dbformat.cc" |
|
|
|
"db/dbformat.h" |
|
|
|
"db/dumpfile.cc" |
|
|
|
"db/filename.cc" |
|
|
|
"db/filename.h" |
|
|
|
"db/log_format.h" |
|
|
|
"db/log_reader.cc" |
|
|
|
"db/log_reader.h" |
|
|
|
"db/log_writer.cc" |
|
|
|
"db/log_writer.h" |
|
|
|
"db/memtable.cc" |
|
|
|
"db/memtable.h" |
|
|
|
"db/repair.cc" |
|
|
|
"db/skiplist.h" |
|
|
|
"db/snapshot.h" |
|
|
|
"db/table_cache.cc" |
|
|
|
"db/table_cache.h" |
|
|
|
"db/version_edit.cc" |
|
|
|
"db/version_edit.h" |
|
|
|
"db/version_set.cc" |
|
|
|
"db/version_set.h" |
|
|
|
"db/write_batch_internal.h" |
|
|
|
"db/write_batch.cc" |
|
|
|
"port/port_stdcxx.h" |
|
|
|
"port/port.h" |
|
|
|
"port/thread_annotations.h" |
|
|
|
"table/block_builder.cc" |
|
|
|
"table/block_builder.h" |
|
|
|
"table/block.cc" |
|
|
|
"table/block.h" |
|
|
|
"table/filter_block.cc" |
|
|
|
"table/filter_block.h" |
|
|
|
"table/format.cc" |
|
|
|
"table/format.h" |
|
|
|
"table/iterator_wrapper.h" |
|
|
|
"table/iterator.cc" |
|
|
|
"table/merger.cc" |
|
|
|
"table/merger.h" |
|
|
|
"table/table_builder.cc" |
|
|
|
"table/table.cc" |
|
|
|
"table/two_level_iterator.cc" |
|
|
|
"table/two_level_iterator.h" |
|
|
|
"util/arena.cc" |
|
|
|
"util/arena.h" |
|
|
|
"util/bloom.cc" |
|
|
|
"util/cache.cc" |
|
|
|
"util/coding.cc" |
|
|
|
"util/coding.h" |
|
|
|
"util/comparator.cc" |
|
|
|
"util/crc32c.cc" |
|
|
|
"util/crc32c.h" |
|
|
|
"util/env.cc" |
|
|
|
"util/filter_policy.cc" |
|
|
|
"util/hash.cc" |
|
|
|
"util/hash.h" |
|
|
|
"util/logging.cc" |
|
|
|
"util/logging.h" |
|
|
|
"util/mutexlock.h" |
|
|
|
"util/no_destructor.h" |
|
|
|
"util/options.cc" |
|
|
|
"util/random.h" |
|
|
|
"util/status.cc" |
|
|
|
|
|
|
|
# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". |
|
|
|
$<$<VERSION_GREATER:CMAKE_VERSION,3.2>:PUBLIC> |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/c.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/cache.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/comparator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/db.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/dumpfile.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/env.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/export.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/filter_policy.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/iterator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/options.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/slice.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/status.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h" |
|
|
|
PRIVATE |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"db/builder.cc" |
|
|
|
"db/builder.h" |
|
|
|
"db/c.cc" |
|
|
|
"db/db_impl.cc" |
|
|
|
"db/db_impl.h" |
|
|
|
"db/db_iter.cc" |
|
|
|
"db/db_iter.h" |
|
|
|
"db/dbformat.cc" |
|
|
|
"db/dbformat.h" |
|
|
|
"db/dumpfile.cc" |
|
|
|
"db/filename.cc" |
|
|
|
"db/filename.h" |
|
|
|
"db/log_format.h" |
|
|
|
"db/log_reader.cc" |
|
|
|
"db/log_reader.h" |
|
|
|
"db/log_writer.cc" |
|
|
|
"db/log_writer.h" |
|
|
|
"db/memtable.cc" |
|
|
|
"db/memtable.h" |
|
|
|
"db/repair.cc" |
|
|
|
"db/skiplist.h" |
|
|
|
"db/snapshot.h" |
|
|
|
"db/table_cache.cc" |
|
|
|
"db/table_cache.h" |
|
|
|
"db/version_edit.cc" |
|
|
|
"db/version_edit.h" |
|
|
|
"db/version_set.cc" |
|
|
|
"db/version_set.h" |
|
|
|
"db/write_batch_internal.h" |
|
|
|
"db/write_batch.cc" |
|
|
|
"port/port_stdcxx.h" |
|
|
|
"port/port.h" |
|
|
|
"port/thread_annotations.h" |
|
|
|
"table/block_builder.cc" |
|
|
|
"table/block_builder.h" |
|
|
|
"table/block.cc" |
|
|
|
"table/block.h" |
|
|
|
"table/filter_block.cc" |
|
|
|
"table/filter_block.h" |
|
|
|
"table/format.cc" |
|
|
|
"table/format.h" |
|
|
|
"table/iterator_wrapper.h" |
|
|
|
"table/iterator.cc" |
|
|
|
"table/merger.cc" |
|
|
|
"table/merger.h" |
|
|
|
"table/table_builder.cc" |
|
|
|
"table/table.cc" |
|
|
|
"table/two_level_iterator.cc" |
|
|
|
"table/two_level_iterator.h" |
|
|
|
"util/arena.cc" |
|
|
|
"util/arena.h" |
|
|
|
"util/bloom.cc" |
|
|
|
"util/cache.cc" |
|
|
|
"util/coding.cc" |
|
|
|
"util/coding.h" |
|
|
|
"util/comparator.cc" |
|
|
|
"util/crc32c.cc" |
|
|
|
"util/crc32c.h" |
|
|
|
"util/env.cc" |
|
|
|
"util/filter_policy.cc" |
|
|
|
"util/hash.cc" |
|
|
|
"util/hash.h" |
|
|
|
"util/logging.cc" |
|
|
|
"util/logging.h" |
|
|
|
"util/mutexlock.h" |
|
|
|
"util/no_destructor.h" |
|
|
|
"util/options.cc" |
|
|
|
"util/random.h" |
|
|
|
"util/status.cc" |
|
|
|
|
|
|
|
# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". |
|
|
|
$<$<VERSION_GREATER:CMAKE_VERSION,3.2>:PUBLIC> |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/c.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/cache.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/comparator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/db.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/dumpfile.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/env.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/export.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/filter_policy.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/iterator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/options.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/slice.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/status.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h" |
|
|
|
) |
|
|
|
|
|
|
|
if (WIN32) |
|
|
|
target_sources(leveldb |
|
|
|
PRIVATE |
|
|
|
"util/env_windows.cc" |
|
|
|
"util/windows_logger.h" |
|
|
|
PRIVATE |
|
|
|
"util/env_windows.cc" |
|
|
|
"util/windows_logger.h" |
|
|
|
) |
|
|
|
else (WIN32) |
|
|
|
target_sources(leveldb |
|
|
|
PRIVATE |
|
|
|
"util/env_posix.cc" |
|
|
|
"util/posix_logger.h" |
|
|
|
PRIVATE |
|
|
|
"util/env_posix.cc" |
|
|
|
"util/posix_logger.h" |
|
|
|
) |
|
|
|
endif (WIN32) |
|
|
|
|
|
|
|
# MemEnv is not part of the interface and could be pulled to a separate library. |
|
|
|
target_sources(leveldb |
|
|
|
PRIVATE |
|
|
|
"helpers/memenv/memenv.cc" |
|
|
|
"helpers/memenv/memenv.h" |
|
|
|
PRIVATE |
|
|
|
"helpers/memenv/memenv.cc" |
|
|
|
"helpers/memenv/memenv.h" |
|
|
|
) |
|
|
|
|
|
|
|
target_include_directories(leveldb |
|
|
|
PUBLIC |
|
|
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> |
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> |
|
|
|
PUBLIC |
|
|
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> |
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> |
|
|
|
) |
|
|
|
|
|
|
|
set_target_properties(leveldb |
|
|
|
PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) |
|
|
|
PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) |
|
|
|
|
|
|
|
target_compile_definitions(leveldb |
|
|
|
PRIVATE |
|
|
|
# Used by include/export.h when building shared libraries. |
|
|
|
LEVELDB_COMPILE_LIBRARY |
|
|
|
# Used by port/port.h. |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
PRIVATE |
|
|
|
# Used by include/export.h when building shared libraries. |
|
|
|
LEVELDB_COMPILE_LIBRARY |
|
|
|
# Used by port/port.h. |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
) |
|
|
|
if (NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
target_compile_definitions(leveldb |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
) |
|
|
|
endif(NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS) |
|
|
|
target_compile_definitions(leveldb |
|
|
|
PUBLIC |
|
|
|
# Used by include/export.h. |
|
|
|
LEVELDB_SHARED_LIBRARY |
|
|
|
PUBLIC |
|
|
|
# Used by include/export.h. |
|
|
|
LEVELDB_SHARED_LIBRARY |
|
|
|
) |
|
|
|
endif(BUILD_SHARED_LIBS) |
|
|
|
|
|
|
|
if(HAVE_CLANG_THREAD_SAFETY) |
|
|
|
target_compile_options(leveldb |
|
|
|
PUBLIC |
|
|
|
-Werror -Wthread-safety) |
|
|
|
PUBLIC |
|
|
|
-Werror -Wthread-safety) |
|
|
|
endif(HAVE_CLANG_THREAD_SAFETY) |
|
|
|
|
|
|
|
if(HAVE_CRC32C) |
|
|
@ -286,7 +286,7 @@ find_package(Threads REQUIRED) |
|
|
|
target_link_libraries(leveldb Threads::Threads) |
|
|
|
|
|
|
|
add_executable(leveldbutil |
|
|
|
"db/leveldbutil.cc" |
|
|
|
"db/leveldbutil.cc" |
|
|
|
) |
|
|
|
target_link_libraries(leveldbutil leveldb) |
|
|
|
|
|
|
@ -305,60 +305,60 @@ if(LEVELDB_BUILD_TESTS) |
|
|
|
# GoogleTest triggers a missing field initializers warning. |
|
|
|
if(LEVELDB_HAVE_NO_MISSING_FIELD_INITIALIZERS) |
|
|
|
set_property(TARGET gtest |
|
|
|
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) |
|
|
|
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) |
|
|
|
set_property(TARGET gmock |
|
|
|
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) |
|
|
|
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) |
|
|
|
endif(LEVELDB_HAVE_NO_MISSING_FIELD_INITIALIZERS) |
|
|
|
|
|
|
|
add_executable(leveldb_tests "") |
|
|
|
target_sources(leveldb_tests |
|
|
|
PRIVATE |
|
|
|
# "db/fault_injection_test.cc" |
|
|
|
# "issues/issue178_test.cc" |
|
|
|
# "issues/issue200_test.cc" |
|
|
|
# "issues/issue320_test.cc" |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
# "util/env_test.cc" |
|
|
|
"util/status_test.cc" |
|
|
|
"util/no_destructor_test.cc" |
|
|
|
"util/testutil.cc" |
|
|
|
"util/testutil.h" |
|
|
|
PRIVATE |
|
|
|
# "db/fault_injection_test.cc" |
|
|
|
# "issues/issue178_test.cc" |
|
|
|
# "issues/issue200_test.cc" |
|
|
|
# "issues/issue320_test.cc" |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
# "util/env_test.cc" |
|
|
|
"util/status_test.cc" |
|
|
|
"util/no_destructor_test.cc" |
|
|
|
"util/testutil.cc" |
|
|
|
"util/testutil.h" |
|
|
|
) |
|
|
|
if(NOT BUILD_SHARED_LIBS) |
|
|
|
target_sources(leveldb_tests |
|
|
|
PRIVATE |
|
|
|
"db/autocompact_test.cc" |
|
|
|
"db/corruption_test.cc" |
|
|
|
"db/db_test.cc" |
|
|
|
"db/dbformat_test.cc" |
|
|
|
"db/filename_test.cc" |
|
|
|
"db/log_test.cc" |
|
|
|
"db/recovery_test.cc" |
|
|
|
"db/skiplist_test.cc" |
|
|
|
"db/version_edit_test.cc" |
|
|
|
"db/version_set_test.cc" |
|
|
|
"db/write_batch_test.cc" |
|
|
|
"helpers/memenv/memenv_test.cc" |
|
|
|
"table/filter_block_test.cc" |
|
|
|
"table/table_test.cc" |
|
|
|
"util/arena_test.cc" |
|
|
|
"util/bloom_test.cc" |
|
|
|
"util/cache_test.cc" |
|
|
|
"util/coding_test.cc" |
|
|
|
"util/crc32c_test.cc" |
|
|
|
"util/hash_test.cc" |
|
|
|
"util/logging_test.cc" |
|
|
|
PRIVATE |
|
|
|
"db/autocompact_test.cc" |
|
|
|
"db/corruption_test.cc" |
|
|
|
"db/db_test.cc" |
|
|
|
"db/dbformat_test.cc" |
|
|
|
"db/filename_test.cc" |
|
|
|
"db/log_test.cc" |
|
|
|
"db/recovery_test.cc" |
|
|
|
"db/skiplist_test.cc" |
|
|
|
"db/version_edit_test.cc" |
|
|
|
"db/version_set_test.cc" |
|
|
|
"db/write_batch_test.cc" |
|
|
|
"helpers/memenv/memenv_test.cc" |
|
|
|
"table/filter_block_test.cc" |
|
|
|
"table/table_test.cc" |
|
|
|
"util/arena_test.cc" |
|
|
|
"util/bloom_test.cc" |
|
|
|
"util/cache_test.cc" |
|
|
|
"util/coding_test.cc" |
|
|
|
"util/crc32c_test.cc" |
|
|
|
"util/hash_test.cc" |
|
|
|
"util/logging_test.cc" |
|
|
|
) |
|
|
|
endif(NOT BUILD_SHARED_LIBS) |
|
|
|
target_link_libraries(leveldb_tests leveldb gmock gtest gtest_main) |
|
|
|
target_compile_definitions(leveldb_tests |
|
|
|
PRIVATE |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
PRIVATE |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
) |
|
|
|
if (NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
target_compile_definitions(leveldb_tests |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
) |
|
|
|
endif(NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
|
|
|
@ -369,22 +369,22 @@ if(LEVELDB_BUILD_TESTS) |
|
|
|
|
|
|
|
add_executable("${test_target_name}" "") |
|
|
|
target_sources("${test_target_name}" |
|
|
|
PRIVATE |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"util/testutil.cc" |
|
|
|
"util/testutil.h" |
|
|
|
PRIVATE |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"util/testutil.cc" |
|
|
|
"util/testutil.h" |
|
|
|
|
|
|
|
"${test_file}" |
|
|
|
"${test_file}" |
|
|
|
) |
|
|
|
target_link_libraries("${test_target_name}" leveldb gmock gtest) |
|
|
|
target_compile_definitions("${test_target_name}" |
|
|
|
PRIVATE |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
PRIVATE |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
) |
|
|
|
if (NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
target_compile_definitions("${test_target_name}" |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
) |
|
|
|
endif(NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
|
|
|
@ -415,24 +415,24 @@ if(LEVELDB_BUILD_BENCHMARKS) |
|
|
|
|
|
|
|
add_executable("${bench_target_name}" "") |
|
|
|
target_sources("${bench_target_name}" |
|
|
|
PRIVATE |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"util/histogram.cc" |
|
|
|
"util/histogram.h" |
|
|
|
"util/testutil.cc" |
|
|
|
"util/testutil.h" |
|
|
|
|
|
|
|
"${bench_file}" |
|
|
|
PRIVATE |
|
|
|
"${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h" |
|
|
|
"util/histogram.cc" |
|
|
|
"util/histogram.h" |
|
|
|
"util/testutil.cc" |
|
|
|
"util/testutil.h" |
|
|
|
|
|
|
|
"${bench_file}" |
|
|
|
) |
|
|
|
target_link_libraries("${bench_target_name}" leveldb gmock gtest benchmark) |
|
|
|
target_compile_definitions("${bench_target_name}" |
|
|
|
PRIVATE |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
PRIVATE |
|
|
|
${LEVELDB_PLATFORM_NAME}=1 |
|
|
|
) |
|
|
|
if (NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
target_compile_definitions("${bench_target_name}" |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
PRIVATE |
|
|
|
LEVELDB_HAS_PORT_CONFIG_H=1 |
|
|
|
) |
|
|
|
endif(NOT HAVE_CXX17_HAS_INCLUDE) |
|
|
|
endfunction(leveldb_benchmark) |
|
|
@ -470,51 +470,51 @@ endif(LEVELDB_BUILD_BENCHMARKS) |
|
|
|
|
|
|
|
if(LEVELDB_INSTALL) |
|
|
|
install(TARGETS leveldb |
|
|
|
EXPORT leveldbTargets |
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
|
|
|
EXPORT leveldbTargets |
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
|
|
|
) |
|
|
|
install( |
|
|
|
FILES |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/c.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/cache.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/comparator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/db.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/dumpfile.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/env.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/export.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/filter_policy.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/iterator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/options.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/slice.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/status.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h" |
|
|
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/leveldb" |
|
|
|
FILES |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/c.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/cache.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/comparator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/db.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/dumpfile.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/env.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/export.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/filter_policy.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/iterator.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/options.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/slice.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/status.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h" |
|
|
|
"${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h" |
|
|
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/leveldb" |
|
|
|
) |
|
|
|
|
|
|
|
include(CMakePackageConfigHelpers) |
|
|
|
configure_package_config_file( |
|
|
|
"cmake/${PROJECT_NAME}Config.cmake.in" |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" |
|
|
|
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" |
|
|
|
"cmake/${PROJECT_NAME}Config.cmake.in" |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" |
|
|
|
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" |
|
|
|
) |
|
|
|
write_basic_package_version_file( |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" |
|
|
|
COMPATIBILITY SameMajorVersion |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" |
|
|
|
COMPATIBILITY SameMajorVersion |
|
|
|
) |
|
|
|
install( |
|
|
|
EXPORT leveldbTargets |
|
|
|
NAMESPACE leveldb:: |
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" |
|
|
|
EXPORT leveldbTargets |
|
|
|
NAMESPACE leveldb:: |
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" |
|
|
|
) |
|
|
|
install( |
|
|
|
FILES |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" |
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" |
|
|
|
FILES |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" |
|
|
|
"${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" |
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" |
|
|
|
) |
|
|
|
endif(LEVELDB_INSTALL) |
|
|
|
|
|
|
@ -527,4 +527,9 @@ target_link_libraries(db_test1 leveldb) |
|
|
|
add_executable(db_test2 |
|
|
|
"${PROJECT_SOURCE_DIR}/test/db_test2.cc" |
|
|
|
) |
|
|
|
target_link_libraries(db_test2 PRIVATE leveldb) |
|
|
|
target_link_libraries(db_test2 PRIVATE leveldb) |
|
|
|
|
|
|
|
add_executable(db_test3 |
|
|
|
"${PROJECT_SOURCE_DIR}/test/db_test3.cc" |
|
|
|
) |
|
|
|
target_link_libraries(db_test3 PRIVATE leveldb gtest) |