From b372364a2cebb841b638e912b4fa684f2ee176e9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Aug 2020 17:21:17 +0400 Subject: [PATCH] Add _DISABLE_WEBRTC_INTEGRATION option. --- external/CMakeLists.txt | 4 +++- options.cmake | 7 +++++++ variables.cmake | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 413c308..5882bbb 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -59,6 +59,8 @@ if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) endif() add_checked_subdirectory(ton) add_checked_subdirectory(variant) -add_checked_subdirectory(webrtc) +if (NOT DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION) + add_checked_subdirectory(webrtc) +endif() add_checked_subdirectory(xxhash) add_checked_subdirectory(zlib) diff --git a/options.cmake b/options.cmake index c774b3e..8d1c52b 100644 --- a/options.cmake +++ b/options.cmake @@ -26,6 +26,13 @@ if (DESKTOP_APP_DISABLE_DBUS_INTEGRATION) ) endif() +if (DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION) + target_compile_definitions(common_options + INTERFACE + DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION + ) +endif() + if (DESKTOP_APP_USE_PACKAGED) target_compile_definitions(common_options INTERFACE diff --git a/variables.cmake b/variables.cmake index 48798c6..eb913e6 100644 --- a/variables.cmake +++ b/variables.cmake @@ -19,8 +19,14 @@ if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "osx") set(osx_special_target 1) endif() +set(webrtc_not_supported 0) +if (osx_special_target OR (LINUX AND CMAKE_SIZEOF_VOID_P EQUAL 4)) + set(webrtc_not_supported 1) +endif() + option(DESKTOP_APP_LOTTIE_USE_CACHE "Use caching in lottie animations." ON) option(DESKTOP_APP_DISABLE_DBUS_INTEGRATION "Disable all code for D-Bus integration (Linux only)." OFF) +option(DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION "Disable all code for WebRTC integration." ${webrtc_not_supported}) option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." ${linux_special_target}) option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." ${no_special_target}) option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF)