Skip to content

Commit

Permalink
Merge branch 'master' into mam
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Jul 13, 2024
2 parents 6d76ccd + fa41062 commit b667bca
Show file tree
Hide file tree
Showing 68 changed files with 3,908 additions and 1,352 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ include(policyRules)

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)

# Detect MXE cross-compilation
set(IRIS_DEFAULT_BUNDLED_USRSCTP OFF)
Expand All @@ -61,15 +61,14 @@ endif()

option(IRIS_ENABLE_INSTALL "Enable installation" ON)
option(IRIS_ENABLE_JINGLE_SCTP "Enable SCTP over ICE Jingle transport / data channels" ON)
option(IRIS_BUNDLED_QCA "Adds: DTLS, Blake2b and other useful for XMPP crypto-stuff" ${IRIS_DEFAULT_BUNDLED_QCA})
# note Blake2b is needed only with Qt5. Qt6 has its own implementation
option(IRIS_BUNDLED_QCA "Adds: DTLS, Blake2b (needed with Qt5) and other useful for XMPP crypto-stuff" ${IRIS_DEFAULT_BUNDLED_QCA})
option(IRIS_BUNDLED_USRSCTP "Compile compatible UsrSCTP lib (required for datachannel Jingle transport)" ${IRIS_DEFAULT_BUNDLED_USRSCTP})
option(IRIS_BUILD_TOOLS "Build tools and examples" OFF)
option(IRIS_ENABLE_DEBUG "Enable debugging code paths" OFF)

set(IRIS_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/xmpp/iris)

set(CMAKE_CXX_STANDARD 17)

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo"))
include(debug-definitions)
endif()
Expand Down Expand Up @@ -101,7 +100,7 @@ if(IRIS_ENABLE_JINGLE_SCTP)
include(IrisSCTP)
endif()

if(NOT IRIS_BUNDLED_QCA)
if(NOT IRIS_BUNDLED_QCA AND QT_DEFAULT_MAJOR_VERSION LESS 6)
find_package(B2 QUIET)
if(B2_FOUND)
message(STATUS "Found B2: ${B2_LIBRARY}")
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/IrisQCA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ if(IRIS_BUNDLED_QCA)
CMAKE_ARGS ${QCA_BUILD_OPTIONS}
BUILD_BYPRODUCTS ${Qca_LIBRARY}
INSTALL_COMMAND ""
UPDATE_COMMAND ""
)
endif()
else()
Expand Down
18 changes: 14 additions & 4 deletions cmake/modules/IrisSCTP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ else()
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND USRSCTP_BUILD_OPTIONS -DCMAKE_C_FLAGS="-Wno-maybe-uninitialized")
endif()
# Setting these options seems to have no any effect because those prepended and not appended
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# list(APPEND USRSCTP_BUILD_OPTIONS "-DCMAKE_C_FLAGS=-Wno-maybe-uninitialized")
# endif()
# if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# list(APPEND USRSCTP_BUILD_OPTIONS "-DCMAKE_C_FLAGS=-Wno-uninitialized -Wno-unused-but-set-variable")
# endif()
if (EXISTS ${USRSCTP_SOURCE_DIR})
message(STATUS "USRSCTP: found bundled sources")
ExternalProject_Add(UsrSCTPProject
Expand All @@ -56,14 +60,20 @@ else()
if(NOT Git_FOUND)
message(FATAL_ERROR "Git not found! Bundled UsrSCTP needs Git utility.\nPlease set GIT_EXECUTABLE variable or add git to PATH")
endif()
set(patch_command
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/usrsctp.patch <SOURCE_DIR> &&
${GIT_EXECUTABLE} checkout <SOURCE_DIR>/usrsctplib/netinet/sctp_output.c &&
${GIT_EXECUTABLE} apply <SOURCE_DIR>/usrsctp.patch)
ExternalProject_Add(UsrSCTPProject
PREFIX ${USRSCTP_PREFIX}
BINARY_DIR ${USRSCTP_BUILD_DIR}
GIT_REPOSITORY ${IrisSCTPGitRepo}
GIT_TAG a17109528c75d01f6372d5c30851a639684c6e99
GIT_TAG 848eca82f92273af9a79687a90343a2ebcf3481d
CMAKE_ARGS ${USRSCTP_BUILD_OPTIONS}
BUILD_BYPRODUCTS ${USRSCTP_LIBRARY}
INSTALL_COMMAND ""
PATCH_COMMAND ${patch_command}
UPDATE_COMMAND ""
)
endif()
add_library(SctpLab::UsrSCTP UNKNOWN IMPORTED)
Expand Down
19 changes: 19 additions & 0 deletions cmake/modules/usrsctp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c
index b8a7b46..6f9c9b9 100644
--- a/usrsctplib/netinet/sctp_output.c
+++ b/usrsctplib/netinet/sctp_output.c
@@ -13562,10 +13562,10 @@ sctp_lower_sosend(struct socket *so,
#endif
struct timeval now;
struct sctp_block_entry be;
- struct sctp_inpcb *inp;
+ struct sctp_inpcb *inp = NULL;
struct sctp_tcb *stcb = NULL;
struct sctp_nets *net;
- struct sctp_association *asoc;
+ struct sctp_association *asoc = NULL;
struct sctp_inpcb *t_inp;
struct sctp_nonpad_sndrcvinfo *sndrcvninfo;
ssize_t sndlen = 0, max_len, local_add_more;
1 change: 1 addition & 0 deletions include/iris/xmpp_vcard4.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "xmpp/xmpp-im/xmpp_vcard4.h"
2 changes: 1 addition & 1 deletion src/irisnet/corelib/netinterface_qtnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class InterfaceMonitor : public QObject {
notifier = new QSocketNotifier(netlinkFd, QSocketNotifier::Read, this);

connect(notifier, &QSocketNotifier::activated, this,
[=](QSocketDescriptor, QSocketNotifier::Type) { emit changed(); });
[this](QSocketDescriptor, QSocketNotifier::Type) { emit changed(); });
}

~InterfaceMonitor()
Expand Down
Loading

0 comments on commit b667bca

Please sign in to comment.