Page MenuHomePhorge

D4299.1767372768.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D4299.1767372768.diff

diff --git a/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt b/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt
@@ -0,0 +1,60 @@
+project(comm-cryptotools)
+cmake_minimum_required(VERSION 3.4)
+
+include(GNUInstallDirs)
+
+set(CMAKE_CXX_STANDARD 14)
+
+set(CRYPTO_HDRS
+ "CryptoModule.h"
+ "Persist.h"
+ "Session.h"
+ "Tools.h"
+)
+
+set(CRYPTO_SRCS
+ "CryptoModule.cpp"
+ "Session.cpp"
+ "Tools.cpp"
+)
+
+add_library(comm-cryptotools
+ ${CRYPTO_HDRS}
+ ${CRYPTO_SRCS}
+)
+
+find_package(Olm)
+
+target_link_libraries(comm-cryptotools
+ Olm::Olm
+)
+
+# reference local directory when building, use installation path when installing
+target_include_directories(comm-cryptotools
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../Tools>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
+
+install(TARGETS comm-cryptotools EXPORT comm-cryptotools-export
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-cryptotools
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools
+)
+
+install(FILES ${TOOLS_HDRS} DESTINATION include/Tools)
+
+set(_builddir_export_path cmake/comm-cryptotools/comm-cryptotools-targets.cmake)
+export(TARGETS comm-cryptotools
+ NAMESPACE comm-cryptotools::
+ FILE ${CMAKE_CURRENT_BINARY_DIR}/${_builddir_export_path}
+)
+
+# For installation
+install(EXPORT comm-cryptotools-export
+ FILE comm-cryptotools-targets.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-cryptotools
+ NAMESPACE comm-cryptotools::
+)
diff --git a/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp b/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp
--- a/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp
+++ b/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp
@@ -2,6 +2,8 @@
#include "PlatformSpecificTools.h"
#include "olm/session.hh"
+#include <stdexcept>
+
namespace comm {
namespace crypto {
diff --git a/native/cpp/CommonCpp/CryptoTools/Session.cpp b/native/cpp/CommonCpp/CryptoTools/Session.cpp
--- a/native/cpp/CommonCpp/CryptoTools/Session.cpp
+++ b/native/cpp/CommonCpp/CryptoTools/Session.cpp
@@ -1,6 +1,8 @@
#include "Session.h"
#include "PlatformSpecificTools.h"
+#include <stdexcept>
+
namespace comm {
namespace crypto {
diff --git a/native/cpp/CommonCpp/CryptoTools/Tools.h b/native/cpp/CommonCpp/CryptoTools/Tools.h
--- a/native/cpp/CommonCpp/CryptoTools/Tools.h
+++ b/native/cpp/CommonCpp/CryptoTools/Tools.h
@@ -1,5 +1,7 @@
#pragma once
+#include <cstdint>
+#include <string>
#include <vector>
#include "olm/olm.h"

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 2, 4:52 PM (13 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5880709
Default Alt Text
D4299.1767372768.diff (2 KB)

Event Timeline