diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/rgw/driver/dbstore/CMakeLists.txt | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rgw/driver/dbstore/CMakeLists.txt')
-rw-r--r-- | src/rgw/driver/dbstore/CMakeLists.txt | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/rgw/driver/dbstore/CMakeLists.txt b/src/rgw/driver/dbstore/CMakeLists.txt new file mode 100644 index 000000000..a3aca7a64 --- /dev/null +++ b/src/rgw/driver/dbstore/CMakeLists.txt @@ -0,0 +1,71 @@ +#need to update cmake version here +cmake_minimum_required(VERSION 3.14.0) +project(dbstore) + +option(USE_SQLITE "Enable SQLITE DB" ON) + +set (CMAKE_INCLUDE_DIR ${CMAKE_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/common") + +set(dbstore_srcs + common/dbstore_log.h + common/dbstore.h + common/dbstore.cc + config/store.cc) +IF(USE_SQLITE) + list(APPEND dbstore_srcs + config/sqlite.cc + sqlite/connection.cc + sqlite/error.cc + sqlite/statement.cc) +endif() + +set(dbstore_mgr_srcs + dbstore_mgr.h + dbstore_mgr.cc + ) + +add_library(dbstore_lib ${dbstore_srcs}) +target_include_directories(dbstore_lib + PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw" + PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/store/rados" + PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") +set(link_targets spawn) +if(WITH_JAEGER) + list(APPEND link_targets jaeger_base) +endif() +list(APPEND link_targets rgw_common) +target_link_libraries(dbstore_lib PUBLIC ${link_targets}) + +set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore_lib) + +IF(USE_SQLITE) + add_subdirectory(sqlite) + set(CMAKE_INCLUDE_DIR ${CMAKE_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/sqlite") + add_compile_definitions(SQLITE_ENABLED=1) + set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} rgw_common) + set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} sqlite_db) + add_dependencies(sqlite_db dbstore_lib) +ENDIF() + +# add pthread library +set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} pthread) + +find_package(gtest QUIET) +if(WITH_TESTS) + add_subdirectory(tests) +else() + message(WARNING "Gtest not enabled") +endif() + +include_directories(${CMAKE_INCLUDE_DIR}) +add_library(dbstore STATIC ${dbstore_mgr_srcs}) +target_link_libraries(dbstore ${CMAKE_LINK_LIBRARIES}) + +# testing purpose +set(dbstore_main_srcs + dbstore_main.cc) + +set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore) +add_executable(dbstore-bin ${dbstore_main_srcs}) +add_dependencies(dbstore-bin dbstore) +target_link_libraries(dbstore-bin ${CMAKE_LINK_LIBRARIES}) |