Skip to content

Commit db96ea2

Browse files
committed
minor fixes
1 parent 2e6541f commit db96ea2

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ after the core completion.
112112
- (may be) *nix
113113
- (may be) mac os x
114114

115+
# changes
116+
117+
## 0.1.0 (18-Arp-2022)
118+
- initial release
119+
115120
# building from source
116121

117122
[see](docs/building.md)

src/model/device_id.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ device_id_t::device_id_t(std::string_view value_, std::string_view sha256_) noex
2121
std::copy(sha256_.begin(), sha256_.end(), hash + 1);
2222
}
2323

24+
device_id_t::device_id_t(device_id_t &&other) noexcept {
25+
*this = std::move(other);
26+
}
27+
28+
device_id_t& device_id_t::operator=(device_id_t &&other) noexcept {
29+
value = std::move(other.value);
30+
std::copy(other.hash, other.hash + data_length, hash);
31+
return *this;
32+
}
33+
34+
device_id_t& device_id_t::operator=(const device_id_t &other) noexcept {
35+
value = other.value;
36+
std::copy(other.hash, other.hash + data_length, hash);
37+
return *this;
38+
}
39+
40+
2441
std::string_view device_id_t::get_short() const noexcept { return std::string_view(value.data(), DASH_INT); }
2542

2643
std::optional<device_id_t> device_id_t::from_string(std::string_view value) noexcept {

src/model/device_id.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ struct SYNCSPIRIT_API device_id_t {
3030
static std::optional<device_id_t> from_uuid(std::string_view value) noexcept;
3131

3232
device_id_t() noexcept {};
33+
device_id_t(device_id_t &&other) noexcept;
34+
device_id_t(const device_id_t &other) = default;
35+
36+
device_id_t& operator=(device_id_t &&other) noexcept;
37+
device_id_t& operator=(const device_id_t &other) noexcept;
3338

3439
bool operator==(const device_id_t &other) const noexcept { return get_sha256() == other.get_sha256(); }
3540
bool operator!=(const device_id_t &other) const noexcept { return !(*this == other); }

src/transport/impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ template <> struct base_impl_t<ssl_socket_t> {
156156

157157
auto peer = std::move(peer_option.value());
158158
if (!actual_peer) {
159-
actual_peer = peer;
159+
actual_peer = std::move(peer);
160160
spdlog::trace("tls, peer device_id = {}", actual_peer);
161161
}
162162

src/ui-daemon/CMakeLists.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ target_link_libraries(syncspirit-daemon
1919
)
2020
target_include_directories(syncspirit-daemon PUBLIC ${syncspirit_SOURCE_DIR}/src)
2121

22-
message(STATUS "build type ${CMAKE_BUILD_TYPE}")
23-
2422
if (("${CMAKE_BUILD_TYPE}" STREQUAL "Release") AND (NOT WIN32))
2523
include(CheckIPOSupported)
2624
check_ipo_supported(RESULT supported OUTPUT error)
@@ -31,3 +29,23 @@ if (("${CMAKE_BUILD_TYPE}" STREQUAL "Release") AND (NOT WIN32))
3129
message(STATUS "IPO / LTO not supported: <${error}>")
3230
endif()
3331
endif()
32+
33+
if (CMAKE_BUILD_TYPE MATCHES "^([Rr]elease)|(MinSizeRel)")
34+
set_target_properties(syncspirit-daemon PROPERTIES LINK_FLAGS -s)
35+
set(DAEMON_TARGET "${CMAKE_CXX_COMPILER}")
36+
string(REGEX REPLACE ".*/" "" DAEMON_TARGET ${DAEMON_TARGET})
37+
string(REGEX REPLACE "(.*)-.+" "\\1" DAEMON_TARGET ${DAEMON_TARGET})
38+
if ("${DAEMON_TARGET}" STREQUAL "")
39+
set(DAEMON_TARGET "unknown")
40+
endif()
41+
string(JOIN "_" DAEMON_TARGET "syncspirit-daemon" ${SYNCSPIRIT_VERSION} ${DAEMON_TARGET})
42+
set(DAEMON_TARGET "${DAEMON_TARGET}.zip")
43+
set(ACHIVE_NAME "${syncspirit_BINARY_DIR}/${DAEMON_TARGET}")
44+
message(STATUS "going to make an ${ACHIVE_NAME}")
45+
add_custom_target(make_archive ALL
46+
COMMAND zip "-q9" "${ACHIVE_NAME}" "syncspirit-daemon${CMAKE_EXECUTABLE_SUFFIX}"
47+
DEPENDS "syncspirit-daemon${CMAKE_EXECUTABLE_SUFFIX}"
48+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
49+
COMMENT "making release archive ${DAEMON_TARGET}"
50+
VERBATIM)
51+
endif()

0 commit comments

Comments
 (0)