Skip to content

Commit

Permalink
sync: use silkworm_library
Browse files Browse the repository at this point in the history
  • Loading branch information
battlmonstr committed Mar 12, 2024
1 parent 3250748 commit c0b2c9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
7 changes: 0 additions & 7 deletions cmd/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ else()
endif()

if(NOT SILKWORM_CORE_ONLY)
find_package(GTest REQUIRED)

# Enable fuzzing tests for Clang sanitizer builds only
if("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang$" AND SILKWORM_FUZZER)
# macOS on 64-bit ARM does not support option -fsanitize=leak
Expand Down Expand Up @@ -65,11 +63,6 @@ if(NOT SILKWORM_CORE_ONLY)
)
endif()

# Silkworm Sync Tests
file(GLOB_RECURSE SILKWORM_SYNC_TESTS CONFIGURE_DEPENDS "${SILKWORM_MAIN_SRC_DIR}/sync/*_test.cpp")
add_executable(sync_test unit_test.cpp ${SILKWORM_SYNC_TESTS})
target_link_libraries(sync_test silkworm_node silkworm_sync Catch2::Catch2 GTest::gmock)

# Ethereum EL Tests (https://github.com/ethereum/tests)
find_package(CLI11 REQUIRED)
add_executable(ethereum ethereum.cpp)
Expand Down
14 changes: 6 additions & 8 deletions silkworm/sync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
limitations under the License.
]]

include("${SILKWORM_MAIN_DIR}/cmake/common/targets.cmake")

find_package(absl REQUIRED)
find_package(GTest REQUIRED)
find_package(magic_enum REQUIRED)

file(GLOB_RECURSE SILKWORM_SYNC_SRC CONFIGURE_DEPENDS "*.cpp" "*.hpp")
list(FILTER SILKWORM_SYNC_SRC EXCLUDE REGEX "_test\\.cpp$")

add_library(silkworm_sync "${SILKWORM_SYNC_SRC}")

set(SILKWORM_SYNC_PUBLIC_LIBS
silkworm_rpcdaemon
silkworm_node
Expand All @@ -32,8 +30,6 @@ set(SILKWORM_SYNC_PUBLIC_LIBS
absl::btree
)

target_include_directories(silkworm_sync PUBLIC "${SILKWORM_MAIN_DIR}")

# cmake-format: off
set(SILKWORM_SYNC_PRIVATE_LIBS
cborcpp
Expand All @@ -42,8 +38,10 @@ set(SILKWORM_SYNC_PRIVATE_LIBS
)
# cmake-format: on

target_link_libraries(
silkworm_library(
silkworm_sync
PUBLIC ${SILKWORM_SYNC_PUBLIC_LIBS}
PRIVATE ${SILKWORM_SYNC_PRIVATE_LIBS}
)

target_link_libraries(silkworm_sync_test PRIVATE GTest::gmock silkworm_db_test_util)

0 comments on commit c0b2c9a

Please sign in to comment.