Skip to content

Commit

Permalink
Remove unused code, cleanup cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Oct 24, 2023
1 parent 09ad273 commit c09b365
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 467 deletions.
38 changes: 18 additions & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
cmake_minimum_required (VERSION 3.11)

add_flags("-Wall -Wextra -Werror -Wpedantic")
include_directories (BEFORE include/)
include_directories (AFTER .)

find_package(Threads QUIET REQUIRED)
find_package(sisl QUIET REQUIRED)
find_package(homestore QUIET REQUIRED)

link_directories(${spdk_LIB_DIRS} ${dpdk_LIB_DIRS})

set (COMMON_DEPS
homestore::homestore
sisl::sisl
)
list(APPEND COMMON_DEPS homestore::homestore)

set(COMMON_TEST_DEPS
${COMMON_DEPS}
GTest::gmock
${spdk_LIBRARY_LIST}
${dpdk_LIBRARY_LIST}
)
add_flags("-Wall -Wextra -Werror -Wpedantic")

include_directories (BEFORE .)
include_directories (BEFORE include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/lib)
if(BUILD_TESTING)
# This is a work-around for not being able to specify the link
# order in a conan recipe. We link these explicitly and thus
# need to specify the LINK path. They should only be needed
# to build a DSO (test executable) however.
link_directories(${spdk_LIB_DIRS} ${dpdk_LIB_DIRS})
list(APPEND COMMON_TEST_DEPS
${COMMON_DEPS}
GTest::gmock
${spdk_LIBRARY_LIST}
${dpdk_LIBRARY_LIST}
)
endif()

add_subdirectory(lib)
#add_subdirectory(mocks)
14 changes: 7 additions & 7 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ add_flags("-Wno-unused-parameter")

add_library(${PROJECT_NAME}_core OBJECT)
target_sources(${PROJECT_NAME}_core PRIVATE
homeobject_impl.cpp
blob_manager.cpp
shard_manager.cpp
pg_manager.cpp
)
homeobject_impl.cpp
blob_manager.cpp
shard_manager.cpp
pg_manager.cpp
)
target_link_libraries(${PROJECT_NAME}_core
${COMMON_DEPS}
)
${COMMON_DEPS}
)

if(BUILD_TESTING)
add_subdirectory(tests)
Expand Down
46 changes: 23 additions & 23 deletions src/lib/homestore_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ cmake_minimum_required (VERSION 3.11)

add_library ("${PROJECT_NAME}_homestore")
target_sources("${PROJECT_NAME}_homestore" PRIVATE
hs_homeobject.cpp
hs_blob_manager.cpp
hs_shard_manager.cpp
hs_pg_manager.cpp
index_kv.cpp
heap_chunk_selector.cpp
replication_state_machine.cpp
$<TARGET_OBJECTS:${PROJECT_NAME}_core>
)
hs_homeobject.cpp
hs_blob_manager.cpp
hs_shard_manager.cpp
hs_pg_manager.cpp
index_kv.cpp
heap_chunk_selector.cpp
replication_state_machine.cpp
)
target_link_libraries("${PROJECT_NAME}_homestore"
${COMMON_DEPS}
)
${COMMON_DEPS}
)

if(BUILD_TESTING)
add_subdirectory(tests)
add_subdirectory(tests)

add_executable (homestore_test)
target_sources(homestore_test PRIVATE
$<TARGET_OBJECTS:homestore_tests>
$<TARGET_OBJECTS:test_fixture>
)
target_link_libraries(homestore_test
homeobject_homestore
${COMMON_TEST_DEPS}
)
add_test(NAME HomestoreTest COMMAND homestore_test -csv error --executor immediate)
set_property(TEST HomestoreTest PROPERTY RUN_SERIAL 1)
add_executable (homestore_test)
target_sources(homestore_test PRIVATE
$<TARGET_OBJECTS:homestore_tests>
$<TARGET_OBJECTS:test_fixture>
$<TARGET_OBJECTS:${PROJECT_NAME}_core>
)
target_link_libraries(homestore_test
homeobject_homestore
${COMMON_TEST_DEPS}
)
add_test(NAME HomestoreTest COMMAND homestore_test -csv error --executor immediate)
set_property(TEST HomestoreTest PROPERTY RUN_SERIAL 1)
endif()
14 changes: 8 additions & 6 deletions src/lib/memory_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@ cmake_minimum_required (VERSION 3.11)
add_library ("${PROJECT_NAME}_memory")
target_sources("${PROJECT_NAME}_memory" PRIVATE
mem_homeobject.cpp
mem_blob_manager.cpp
mem_shard_manager.cpp
mem_blob_manager.cpp
mem_shard_manager.cpp
mem_pg_manager.cpp
$<TARGET_OBJECTS:${PROJECT_NAME}_core>
)
target_link_libraries("${PROJECT_NAME}_memory"
${COMMON_DEPS}
${COMMON_DEPS}
)

if(BUILD_TESTING)
add_executable (memory_test)
target_sources(memory_test PRIVATE $<TARGET_OBJECTS:test_fixture>)
target_sources(memory_test PRIVATE
$<TARGET_OBJECTS:test_fixture>
$<TARGET_OBJECTS:${PROJECT_NAME}_core>
)
target_link_libraries(memory_test
homeobject_memory
${COMMON_TEST_DEPS}
)
)
add_test(NAME MemoryTestCPU COMMAND memory_test -csv error --executor cpu --num_iters 20000)
add_test(NAME MemoryTestIO COMMAND memory_test -csv error --executor io --num_iters 20000)
endif()
4 changes: 2 additions & 2 deletions src/lib/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target_sources(test_fixture PRIVATE
ShardManagerTest.cpp
PGManagerTest.cpp
fixture_app.cpp
)
)
target_link_libraries(test_fixture
${COMMON_TEST_DEPS}
)
)
11 changes: 0 additions & 11 deletions src/mocks/CMakeLists.txt

This file was deleted.

58 changes: 0 additions & 58 deletions src/mocks/mock_replica_set.hpp

This file was deleted.

33 changes: 0 additions & 33 deletions src/mocks/repl_decls.h

This file was deleted.

66 changes: 0 additions & 66 deletions src/mocks/repl_service.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions src/mocks/repl_service.h

This file was deleted.

Loading

0 comments on commit c09b365

Please sign in to comment.