aboutsummaryrefslogtreecommitdiffhomepage
path: root/tde2e
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-05-07 23:06:55 +0300
committerlevlam <levlam@telegram.org>2025-05-07 23:06:55 +0300
commitcecb2100de8e2640fd1a10053303e9eb744b872b (patch)
tree7a3bef9ede1812f3dfb1b9c34ce5682f3259e7b1 /tde2e
parentdf72ce5a6962fd8348515f9b7aa5b090af8d3bec (diff)
Add TDE2E_INSTALL_INCLUDES option for tde2e standalone usage.
Diffstat (limited to 'tde2e')
-rw-r--r--tde2e/CMakeLists.txt7
-rw-r--r--tde2e/td/e2e/e2e_errors.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/tde2e/CMakeLists.txt b/tde2e/CMakeLists.txt
index 3e6e91a59..d05b54626 100644
--- a/tde2e/CMakeLists.txt
+++ b/tde2e/CMakeLists.txt
@@ -3,10 +3,14 @@ if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.10"))
endif()
option(TDE2E_ENABLE_INSTALL "Enable installation of the library." ON)
+option(TDE2E_INSTALL_INCLUDES "Enable installation of include files for the library." ON)
if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
+if (NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
+ set(CMAKE_INSTALL_INCLUDEDIR "include")
+endif()
set_source_files_properties(${TL_E2E_AUTO_SOURCE} PROPERTIES GENERATED TRUE)
@@ -83,4 +87,7 @@ if (TDE2E_ENABLE_INSTALL)
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
+ if (TDE2E_INSTALL_INCLUDES)
+ install(FILES td/e2e/e2e_api.h td/e2e/e2e_errors.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/td/e2e")
+ endif()
endif()
diff --git a/tde2e/td/e2e/e2e_errors.h b/tde2e/td/e2e/e2e_errors.h
index 66735716e..00c7bc970 100644
--- a/tde2e/td/e2e/e2e_errors.h
+++ b/tde2e/td/e2e/e2e_errors.h
@@ -41,6 +41,7 @@ enum class ErrorCode : int {
CallFailed = 601,
CallKeyAlreadyUsed = 602
};
+
inline std::string_view error_string(ErrorCode error_code) {
switch (error_code) {
case ErrorCode::Any: