From fcde3de27641fbb4ca6691d07b952f7a288f00ff Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 13 May 2020 16:55:11 +0400 Subject: [PATCH] Add external_webrtc library. --- external/CMakeLists.txt | 1 + external/webrtc/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 external/webrtc/CMakeLists.txt diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index c5db7d7..413c308 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -59,5 +59,6 @@ if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) endif() add_checked_subdirectory(ton) add_checked_subdirectory(variant) +add_checked_subdirectory(webrtc) add_checked_subdirectory(xxhash) add_checked_subdirectory(zlib) diff --git a/external/webrtc/CMakeLists.txt b/external/webrtc/CMakeLists.txt new file mode 100644 index 0000000..3cffcf7 --- /dev/null +++ b/external/webrtc/CMakeLists.txt @@ -0,0 +1,46 @@ +# This file is part of Desktop App Toolkit, +# a set of libraries for developing nice desktop applications. +# +# For license and copyright information please follow this link: +# https://github.com/desktop-app/legal/blob/master/LEGAL + +add_library(external_webrtc INTERFACE IMPORTED GLOBAL) +add_library(desktop-app::external_webrtc ALIAS external_webrtc) + +set(webrtc_loc ${libs_loc}/webrtc/src) +set(webrtc_build_loc ${webrtc_loc}/out/$/obj) +if (WIN32) + set(webrtc_lib_prefix $/) + set(webrtc_lib_suffix .lib) + + target_compile_definitions(external_webrtc + INTERFACE + WEBRTC_WIN + ) +else() + set(webrtc_lib_prefix lib) + set(webrtc_lib_suffix .a) + + target_compile_definitions(external_webrtc + INTERFACE + WEBRTC_POSIX + ) +endif() + +target_include_directories(external_webrtc +INTERFACE + ${webrtc_loc} + ${webrtc_loc}/third_party/abseil-cpp +) + +set(webrtc_libs + webrtc +) +foreach (lib ${webrtc_libs}) + list(APPEND webrtc_libs_list "${webrtc_build_loc}/${lib}${webrtc_lib_suffix}") +endforeach() + +target_link_libraries(external_webrtc +INTERFACE + ${webrtc_libs_list} +)