aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-05-07 23:08:01 +0300
committerlevlam <levlam@telegram.org>2025-05-07 23:08:01 +0300
commite97b65be86e0de75158652e33023e7cdbdd98602 (patch)
tree2b963f6439bbd3c377a05bdbff75e908928de0ed /CMakeLists.txt
parentcecb2100de8e2640fd1a10053303e9eb744b872b (diff)
Add TD_E2E_ONLY CMake configuration option, allowing to build standalone tde2e.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ada919c14..8ad7bf700 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,7 @@ option(TD_ENABLE_DOTNET "Use \"ON\" to enable generation of C++/CLI or C++/CX TD
if (NOT CMAKE_CROSSCOMPILING)
option(TD_GENERATE_SOURCE_FILES "Use \"ON\" to just generate TDLib source files.")
endif()
+option(TD_E2E_ONLY "Use \"ON\" to build and install tde2e instead of TDLib.")
include(CTest)
@@ -174,9 +175,9 @@ if (NOT CMAKE_CROSSCOMPILING)
endif()
endif()
-if (NOT OPENSSL_FOUND)
+if (NOT OPENSSL_FOUND OR TD_GENERATE_SOURCE_FILES)
if (NOT TD_GENERATE_SOURCE_FILES)
- message(WARNING "Can't find OpenSSL: stop TDLib building")
+ message(WARNING "Can't find OpenSSL: stop building")
endif()
return()
endif()
@@ -185,7 +186,15 @@ if (NOT ZLIB_FOUND)
find_package(ZLIB)
endif()
if (NOT ZLIB_FOUND)
- message(WARNING "Can't find zlib: stop TDLib building")
+ message(WARNING "Can't find zlib: stop building")
+ return()
+endif()
+
+set(TDE2E_ENABLE_INSTALL ${TD_INSTALL_STATIC_LIBRARIES} CACHE BOOL "" FORCE)
+set(TDE2E_INSTALL_INCLUDES ${TD_E2E_ONLY} CACHE BOOL "" FORCE)
+add_subdirectory(tde2e)
+
+if (TD_E2E_ONLY)
return()
endif()
@@ -210,9 +219,6 @@ if (BUILD_TESTING)
add_subdirectory(test)
endif()
-set(TDE2E_ENABLE_INSTALL ${TD_INSTALL_STATIC_LIBRARIES} CACHE BOOL "" FORCE)
-add_subdirectory(tde2e)
-
if (NOT CMAKE_CROSSCOMPILING)
add_subdirectory(benchmark)
endif()