Skip to content

Commit

Permalink
Port to matrix-rust-sdk-crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasFella committed Oct 2, 2024
1 parent 9827025 commit 0e268b2
Show file tree
Hide file tree
Showing 52 changed files with 4,052 additions and 6,572 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ compile_commands.json
# Created by doxygen
html/
latex/

matrix-rust-sdk-crypto/target
.kateproject.build
50 changes: 12 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,12 @@ find_package(${Qt} ${QtMinVersion} REQUIRED Core Network Gui Test Sql)
get_filename_component(Qt_Prefix "${${Qt}_DIR}/../../../.." ABSOLUTE)

find_package(${Qt}Keychain REQUIRED)
find_package(Corrosion REQUIRED)
find_package(PkgConfig REQUIRED)

find_package(Olm 3.2.5 REQUIRED)
set_package_properties(Olm PROPERTIES
DESCRIPTION "Implementation of the Olm and Megolm cryptographic ratchets"
URL "https://gitlab.matrix.org/matrix-org/olm"
TYPE REQUIRED
)
pkg_check_modules(SQLITE sqlite3 REQUIRED IMPORTED_TARGET)

find_package(OpenSSL 1.1.0 REQUIRED)
set_package_properties(OpenSSL PROPERTIES
DESCRIPTION "Open source SSL and TLS implementation and cryptographic library"
URL "https://www.openssl.org/"
TYPE REQUIRED
)
corrosion_import_crate(MANIFEST_PATH matrix-rust-sdk-crypto/Cargo.toml)

add_library(${QUOTIENT_LIB_NAME})

Expand Down Expand Up @@ -174,19 +166,8 @@ target_sources(${QUOTIENT_LIB_NAME} PUBLIC FILE_SET HEADERS BASE_DIRS .
Quotient/jobs/syncjob.h
Quotient/jobs/mediathumbnailjob.h
Quotient/jobs/downloadfilejob.h
Quotient/database.h
Quotient/connectionencryptiondata_p.h
Quotient/keyverificationsession.h
Quotient/e2ee/e2ee_common.h
Quotient/e2ee/qolmaccount.h
Quotient/e2ee/qolmsession.h
Quotient/e2ee/qolminboundsession.h
Quotient/e2ee/qolmoutboundsession.h
Quotient/e2ee/qolmutility.h
Quotient/e2ee/qolmsession.h
Quotient/e2ee/qolmmessage.h
Quotient/e2ee/cryptoutils.h
Quotient/e2ee/sssshandler.h
Quotient/events/keyverificationevent.h
Quotient/keyimport.h
Quotient/qt_connection_util.h
Expand Down Expand Up @@ -233,19 +214,8 @@ target_sources(${QUOTIENT_LIB_NAME} PUBLIC FILE_SET HEADERS BASE_DIRS .
Quotient/jobs/syncjob.cpp
Quotient/jobs/mediathumbnailjob.cpp
Quotient/jobs/downloadfilejob.cpp
Quotient/database.cpp
Quotient/connectionencryptiondata_p.cpp
Quotient/keyverificationsession.cpp
Quotient/e2ee/e2ee_common.cpp
Quotient/e2ee/qolmaccount.cpp
Quotient/e2ee/qolmsession.cpp
Quotient/e2ee/qolminboundsession.cpp
Quotient/e2ee/qolmoutboundsession.cpp
Quotient/e2ee/qolmutility.cpp
Quotient/e2ee/qolmsession.cpp
Quotient/e2ee/qolmmessage.cpp
Quotient/e2ee/cryptoutils.cpp
Quotient/e2ee/sssshandler.cpp
Quotient/keyimport.cpp
libquotientemojis.qrc
)
Expand Down Expand Up @@ -363,8 +333,14 @@ target_include_directories(${QUOTIENT_LIB_NAME} PUBLIC
)

target_link_libraries(${QUOTIENT_LIB_NAME}
PUBLIC ${Qt}::Core ${Qt}::Network ${Qt}::Gui qt${${Qt}Core_VERSION_MAJOR}keychain Olm::Olm ${Qt}::Sql
PRIVATE OpenSSL::Crypto ${Qt}::CorePrivate)
PUBLIC ${Qt}::Core ${Qt}::Network ${Qt}::Gui qt${${Qt}Core_VERSION_MAJOR}keychain ${Qt}::Sql
PRIVATE ${Qt}::CorePrivate matrix_rust_sdk_crypto_cpp PkgConfig::SQLITE)


target_include_directories(${QUOTIENT_LIB_NAME} PRIVATE
${CMAKE_BINARY_DIR}/cargo/build/${Rust_CARGO_TARGET}/cxxbridge/matrix-rust-sdk-crypto/src/)



configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${QUOTIENT_LIB_NAME}.pc @ONLY NEWLINE_STYLE UNIX)

Expand Down Expand Up @@ -432,8 +408,6 @@ message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " Header files install prefix: ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_INCLUDEDIR}")
message(STATUS "Using Qt ${${Qt}_VERSION} at ${Qt_Prefix}")
message(STATUS "Using QtKeychain ${${Qt}Keychain_VERSION} at ${${Qt}Keychain_DIR}")
message(STATUS "Using libOlm ${Olm_VERSION} at ${Olm_DIR}")
message(STATUS "Using OpenSSL libcrypto ${OPENSSL_VERSION} at ${OPENSSL_CRYPTO_LIBRARY}")
message(STATUS)
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES
FATAL_ON_MISSING_REQUIRED_PACKAGES)
Expand Down
Loading

0 comments on commit 0e268b2

Please sign in to comment.