Skip to content

Commit

Permalink
Merge branch 'v0.3.0-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
basiliscos committed Apr 14, 2024
2 parents f817f42 + 34d1526 commit dee988b
Show file tree
Hide file tree
Showing 275 changed files with 7,510 additions and 27,706 deletions.
25 changes: 1 addition & 24 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
[submodule "lib/rotor"]
path = lib/rotor
url = https://github.com/basiliscos/cpp-rotor
[submodule "lib/spdlog"]
path = lib/spdlog
url = https://github.com/gabime/spdlog
[submodule "lib/json"]
path = lib/json
url = https://github.com/nlohmann/json.git
[submodule "lib/pugixml"]
path = lib/pugixml
url = https://github.com/zeux/pugixml.git
[submodule "lib/uriparser"]
path = lib/uriparser
url = https://github.com/uriparser/uriparser.git
[submodule "lib/tomlplusplus"]
path = lib/tomlplusplus
url = https://github.com/marzer/tomlplusplus.git
[submodule "lib/lz4"]
path = lib/lz4
url = https://github.com/lz4/lz4.git
[submodule "lib/mbdx"]
path = lib/mbdx
url = https://gitflic.ru/project/erthink/libmdbx.git
[submodule "lib/catch"]
path = lib/catch
url = https://github.com/catchorg/Catch2/

74 changes: 32 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required (VERSION 3.2)
project (syncspirit)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# does not works because of pugixml
#set(CMAKE_CXX_VISIBILITY_PRESET hidden)
#set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
#cmake_policy(SET CMP0063 NEW)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0077 NEW)

include(GenerateExportHeader)
set(CMAKE_POSITION_INDEPENDENT_CODE True)
Expand All @@ -23,11 +23,19 @@ find_package(
find_package(OpenSSL REQUIRED)
find_package(Protobuf REQUIRED)
find_package(ZLIB REQUIRED)
find_package(rotor COMPONENTS asio thread REQUIRED)
find_package(lz4 REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(pugixml REQUIRED)
find_package(uriparser REQUIRED)
find_package(tomlplusplus REQUIRED)
find_package(nlohmann_json REQUIRED)

set(SYNCSPIRIT_VERSION "v0.2.0")
set(SYNCSPIRIT_VERSION "v0.3.0")

configure_file(misc/syncspirit-config.h.in include/syncspirit-config.h @ONLY)
set(Protobuf_IMPORT_DIRS ${syncspirit_SOURCE_DIR}/src)
set(Protobuf_IMPORT_DIRS ${syncspirit_SOURCE_DIR}/src/protobuf)
protobuf_generate_cpp(
PROTO_SRCS PROTO_HDRS
EXPORT_MACRO SYNCSPIRIT_API
Expand Down Expand Up @@ -57,10 +65,11 @@ add_library(syncspirit_lib
src/db/prefix.cpp
src/db/transaction.cpp
src/db/utils.cpp
src/fs/chunk_iterator.cpp
src/fs/file.cpp
src/fs/file_actor.cpp
src/fs/fs_supervisor.cpp
src/fs/messages.cpp
src/fs/new_chunk_iterator.cpp
src/fs/scan_actor.cpp
src/fs/scan_task.cpp
src/fs/utils.cpp
Expand All @@ -86,19 +95,23 @@ add_library(syncspirit_lib
src/model/diff/load/load_cluster.cpp
src/model/diff/load/unknown_folders.cpp
src/model/diff/modify/append_block.cpp
src/model/diff/modify/block_ack.cpp
src/model/diff/modify/block_rej.cpp
src/model/diff/modify/block_transaction.cpp
src/model/diff/modify/blocks_availability.cpp
src/model/diff/modify/clone_block.cpp
src/model/diff/modify/clone_file.cpp
src/model/diff/modify/connect_request.cpp
src/model/diff/modify/create_folder.cpp
src/model/diff/modify/file_availability.cpp
src/model/diff/modify/finish_file.cpp
src/model/diff/modify/flush_file.cpp
src/model/diff/modify/local_update.cpp
src/model/diff/modify/finish_file_ack.cpp
src/model/diff/modify/lock_file.cpp
src/model/diff/modify/new_file.cpp
src/model/diff/modify/mark_reachable.cpp
src/model/diff/modify/local_update.cpp
src/model/diff/modify/relay_connect_request.cpp
src/model/diff/modify/share_folder.cpp
src/model/diff/modify/unshare_folder.cpp
src/model/diff/modify/update_contact.cpp
src/model/diff/modify/update_peer.cpp
src/model/diff/peer/peer_state.cpp
Expand All @@ -109,6 +122,7 @@ add_library(syncspirit_lib
src/model/misc/error_code.cpp
src/model/misc/file_block.cpp
src/model/misc/file_iterator.cpp
src/model/misc/updates_streamer.cpp
src/model/misc/uuid.cpp
src/model/misc/version_utils.cpp
src/model/block_info.cpp
Expand All @@ -121,6 +135,7 @@ add_library(syncspirit_lib
src/model/folder_info.cpp
src/model/ignored_device.cpp
src/model/ignored_folder.cpp
src/model/remote_folder_info.cpp
src/model/unknown_folder.cpp
src/net/acceptor_actor.cpp
src/net/cluster_supervisor.cpp
Expand Down Expand Up @@ -158,41 +173,15 @@ add_library(syncspirit_lib
src/utils/uri.cpp
)

set(BUILD_BOOST_ASIO true CACHE BOOL "BUILD_BOOST_ASIO")
set(URIPARSER_BUILD_WCHAR_T false CACHE BOOL "URIPARSER_BUILD_WCHAR_T")
set(URIPARSER_BUILD_TOOLS false CACHE BOOL "URIPARSER_BUILD_TOOLS")
set(URIPARSER_BUILD_DOCS false CACHE BOOL "DURIPARSER_BUILD_DOCS")
set(URIPARSER_BUILD_TESTS false CACHE BOOL "URIPARSER_BUILD_TESTS")
set(URIPARSER_ENABLE_INSTALL false CACHE BOOL "URIPARSER_ENABLE_INSTALL")
set(BUILD_SHARED_LIBS false CACHE BOOL "BUILD_SHARED_LIBS")
set(LZ4_BUILD_CLI false CACHE BOOL "LZ4_BUILD_CLI")
set(LZ4_BUILD_LEGACY_LZ4C false CACHE BOOL "LZ4_BUILD_LEGACY_LZ4C")
set(MDBX_BUILD_TOOLS false CACHE BOOL "MDBX_BUILD_TOOLS")
set(MDBX_ENABLE_TESTS false CACHE BOOL "MDBX_ENABLE_TESTS")
set(MDBX_BUILD_CXX false CACHE BOOL "MDBX_BUILD_CXX")

cmake_policy(SET CMP0077 NEW)
set(PUGIXML_NO_EXCEPTIONS on)

add_subdirectory("lib/spdlog")
add_subdirectory("lib/lz4/build/cmake/")
add_subdirectory("lib/pugixml")
add_subdirectory("lib/rotor")
add_subdirectory("lib/uriparser")
add_subdirectory("lib/mbdx")


target_include_directories(syncspirit_lib PUBLIC
${syncspirit_SOURCE_DIR}/lib/rotor/include
${syncspirit_SOURCE_DIR}/lib/spdlog/include
${syncspirit_SOURCE_DIR}/lib/spdlog/include/spdlog/
${syncspirit_SOURCE_DIR}/lib/json/include
${syncspirit_SOURCE_DIR}/lib/pugixml/src
${syncspirit_SOURCE_DIR}/lib/uriparser/include
${syncspirit_SOURCE_DIR}/lib/tomlplusplus/include
${syncspirit_SOURCE_DIR}/lib/lz4/lib
${syncspirit_SOURCE_DIR}/lib/mbdx
${Boost_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand All @@ -202,17 +191,18 @@ target_link_libraries(syncspirit_lib
syncspirit_pb
rotor::asio
rotor::thread
pugixml
pugixml::pugixml
Boost::iostreams
Boost::filesystem
Boost::program_options
Boost::system
${Boost_LIBRARIES}
OpenSSL::SSL
fmt::fmt
spdlog::spdlog
uriparser
lz4_static
ZLIB::ZLIB
uriparser::uriparser
tomlplusplus::tomlplusplus
nlohmann_json::nlohmann_json
lz4::lz4
mdbx-static
$<$<PLATFORM_ID:Windows>:iphlpapi>
$<$<PLATFORM_ID:Windows>:ws2_32>
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and still is in heavy development.

# status

- [x] downloading files from peer devices (aka all folders are receive only)
- [x] full-powered files synchronization (aka send and receive)

- [x] [global peer discovery](https://docs.syncthing.net/specs/globaldisco-v3.html)

Expand All @@ -32,7 +32,6 @@ and still is in heavy development.

This list is probably incomplete, here are the most important changes

- [ ] full-powered files synchronization (aka send and receive)

- [ ] conflict resolution

Expand Down Expand Up @@ -118,6 +117,13 @@ after the core completion.

# changes

## 0.3.0 (14-Apr-2024)
- [feature] implemented complete files syncrhonisation
- [feature] added local files watcher and updates streamer
- [build] switched from git submodules to [conan2](https://conan.io)
- [win32] better platform support


## 0.2.0 (22-May-2022)
- [feature] implement [relay transport](https://docs.syncthing.net/specs/relay-v1.html),
the relay is randombly chosen from the public relays [pool](https://relays.syncthing.net/endpoint)
Expand Down
29 changes: 29 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

[requires]
openssl/1.1.1s
boost/1.84.0
lz4/1.9.4
nlohmann_json/3.11.2
protobuf/3.21.9
pugixml/1.13
rotor/0.29
spdlog/1.13.0
tomlplusplus/3.3.0
uriparser/0.9.7
zlib/1.2.13

[test_requires]
catch2/3.3.1

[tool_requires]
protobuf/3.21.9

[options]
pugixml/*:no_exceptions=True
rotor/*:enable_asio=True
rotor/*:enable_thread=True

[generators]
CMakeDeps
CMakeToolchain

Loading

0 comments on commit dee988b

Please sign in to comment.