2020-05-27 18:10:46 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
|
|
|
|
|
|
|
if (NOT OPENSSL_FOUND)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
set(STORAGE_SOURCE
|
|
|
|
LoadSpeed.cpp
|
|
|
|
MerkleTree.cpp
|
|
|
|
NodeActor.cpp
|
|
|
|
PeerActor.cpp
|
|
|
|
PeerState.cpp
|
|
|
|
Torrent.cpp
|
|
|
|
TorrentCreator.cpp
|
|
|
|
TorrentHeader.cpp
|
|
|
|
TorrentInfo.cpp
|
|
|
|
TorrentMeta.cpp
|
|
|
|
|
2022-12-22 09:24:13 +00:00
|
|
|
db.h
|
2020-05-27 18:10:46 +00:00
|
|
|
Bitset.h
|
|
|
|
LoadSpeed.h
|
|
|
|
MerkleTree.h
|
|
|
|
NodeActor.h
|
|
|
|
PartsHelper.h
|
|
|
|
PeerActor.h
|
|
|
|
PeerState.h
|
|
|
|
Torrent.h
|
|
|
|
TorrentCreator.h
|
|
|
|
TorrentHeader.h
|
|
|
|
TorrentInfo.h
|
|
|
|
TorrentMeta.h
|
2022-12-22 09:24:13 +00:00
|
|
|
PeerManager.h
|
|
|
|
MicrochunkTree.h MicrochunkTree.cpp)
|
2020-05-27 18:10:46 +00:00
|
|
|
set(STORAGE_CLI_SOURCE
|
|
|
|
storage-cli.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(storage ${STORAGE_SOURCE})
|
|
|
|
target_link_libraries(storage tdutils tdactor tddb ton_crypto tl_api ${JEMALLOC_LIBRARIES})
|
2022-12-22 09:24:13 +00:00
|
|
|
target_include_directories(storage PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
2020-05-27 18:10:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(storage-cli ${STORAGE_CLI_SOURCE})
|
|
|
|
target_link_libraries(storage-cli storage overlay tdutils tdactor adnl tl_api dht
|
2022-12-22 09:24:13 +00:00
|
|
|
rldp rldp2 fift-lib memprof terminal git ${JEMALLOC_LIBRARIES})
|
2020-05-27 18:10:46 +00:00
|
|
|
|
|
|
|
set(STORAGE_TEST_SOURCE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/storage.cpp
|
|
|
|
PARENT_SCOPE
|
|
|
|
)
|
2022-12-22 09:24:13 +00:00
|
|
|
|
|
|
|
add_subdirectory(storage-daemon)
|
|
|
|
|
2020-05-27 18:10:46 +00:00
|
|
|
# Do not install it yet
|
|
|
|
#install(TARGETS storage-cli RUNTIME DESTINATION bin)
|