mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Get rid of TDESKTOP_USE_PACKAGED_TGVOIP
This commit is contained in:
parent
47673bba50
commit
d97880913c
2 changed files with 37 additions and 31 deletions
|
@ -4,28 +4,30 @@
|
|||
# For license and copyright information please follow this link:
|
||||
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
if (TDESKTOP_USE_PACKAGED_TGVOIP AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
|
||||
add_library(lib_tgvoip INTERFACE IMPORTED GLOBAL)
|
||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
||||
add_library(lib_tgvoip INTERFACE IMPORTED GLOBAL)
|
||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
||||
|
||||
if (DESKTOP_APP_USE_PACKAGED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(TGVOIP REQUIRED IMPORTED_TARGET tgvoip)
|
||||
pkg_check_modules(TGVOIP IMPORTED_TARGET tgvoip)
|
||||
|
||||
target_link_libraries(lib_tgvoip INTERFACE PkgConfig::TGVOIP)
|
||||
else()
|
||||
add_library(lib_tgvoip STATIC)
|
||||
if (TGVOIP_FOUND)
|
||||
target_link_libraries(lib_tgvoip INTERFACE PkgConfig::TGVOIP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT TGVOIP_FOUND)
|
||||
add_library(lib_tgvoip_bundled STATIC)
|
||||
|
||||
if (LINUX)
|
||||
init_target(lib_tgvoip) # All C++20 on Linux, because otherwise ODR violation.
|
||||
init_target(lib_tgvoip_bundled) # All C++20 on Linux, because otherwise ODR violation.
|
||||
else()
|
||||
init_target(lib_tgvoip cxx_std_14)
|
||||
init_target(lib_tgvoip_bundled cxx_std_14)
|
||||
endif()
|
||||
|
||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
||||
|
||||
set(tgvoip_loc ${third_party_loc}/libtgvoip)
|
||||
|
||||
nice_target_sources(lib_tgvoip ${tgvoip_loc}
|
||||
nice_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||
PRIVATE
|
||||
BlockingQueue.cpp
|
||||
BlockingQueue.h
|
||||
|
@ -121,68 +123,68 @@ else()
|
|||
os/posix/NetworkSocketPosix.h
|
||||
)
|
||||
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
TGVOIP_USE_DESKTOP_DSP
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_options(lib_tgvoip
|
||||
target_compile_options(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
/wd4005
|
||||
/wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc)
|
||||
/wd5055 # operator '>' deprecated between enumerations and floating-point types
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
# Doesn't build with mingw for now
|
||||
TGVOIP_NO_DSP
|
||||
)
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
TARGET_OS_OSX
|
||||
TARGET_OSX
|
||||
)
|
||||
if (build_macstore)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
TGVOIP_NO_OSX_PRIVATE_API
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(lib_tgvoip
|
||||
target_compile_options(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
-Wno-unknown-pragmas
|
||||
-Wno-error=sequence-point
|
||||
-Wno-error=unused-result
|
||||
)
|
||||
if (build_linux32 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
|
||||
target_compile_options(lib_tgvoip PRIVATE -msse2)
|
||||
target_compile_options(lib_tgvoip_bundled PRIVATE -msse2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(lib_tgvoip
|
||||
target_include_directories(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
${tgvoip_loc}
|
||||
)
|
||||
|
||||
if (DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION)
|
||||
target_include_directories(lib_tgvoip
|
||||
target_include_directories(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
${tgvoip_loc}/webrtc_dsp
|
||||
)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
TGVOIP_USE_DESKTOP_DSP_BUNDLED
|
||||
WEBRTC_APM_DEBUG_DUMP=0
|
||||
WEBRTC_NS_FLOAT
|
||||
)
|
||||
|
||||
nice_target_sources(lib_tgvoip ${tgvoip_loc}
|
||||
nice_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||
PRIVATE
|
||||
# WebRTC APM
|
||||
webrtc_dsp/system_wrappers/include/field_trial.h
|
||||
|
@ -791,18 +793,18 @@ else()
|
|||
)
|
||||
|
||||
if (WIN32)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
WEBRTC_WIN
|
||||
)
|
||||
elseif (APPLE)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
WEBRTC_POSIX
|
||||
WEBRTC_MAC
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(lib_tgvoip
|
||||
target_compile_definitions(lib_tgvoip_bundled
|
||||
PUBLIC
|
||||
WEBRTC_POSIX
|
||||
WEBRTC_LINUX
|
||||
|
@ -810,13 +812,13 @@ else()
|
|||
endif()
|
||||
|
||||
else()
|
||||
target_link_libraries(lib_tgvoip
|
||||
target_link_libraries(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
desktop-app::external_webrtc
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(lib_tgvoip
|
||||
target_link_libraries(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
desktop-app::external_opus
|
||||
)
|
||||
|
@ -826,16 +828,21 @@ else()
|
|||
pkg_check_modules(ALSA REQUIRED alsa)
|
||||
pkg_check_modules(PULSE REQUIRED libpulse)
|
||||
|
||||
target_include_directories(lib_tgvoip
|
||||
target_include_directories(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
${ALSA_INCLUDE_DIRS}
|
||||
${PULSE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(lib_tgvoip
|
||||
target_link_libraries(lib_tgvoip_bundled
|
||||
PRIVATE
|
||||
${CMAKE_DL_LIBS}
|
||||
pthread
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(lib_tgvoip
|
||||
INTERFACE
|
||||
lib_tgvoip_bundled
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
option(TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME "Disable automatic 'tg://' URL scheme handler registration." OFF)
|
||||
option(TDESKTOP_DISABLE_NETWORK_PROXY "Disable all code for working through Socks5 or MTProxy." OFF)
|
||||
option(TDESKTOP_DISABLE_GTK_INTEGRATION "Disable all code for GTK integration (Linux only)." OFF)
|
||||
option(TDESKTOP_USE_PACKAGED_TGVOIP "Find libtgvoip using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
||||
option(TDESKTOP_API_TEST "Use test API credentials." OFF)
|
||||
set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.")
|
||||
set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.")
|
||||
|
|
Loading…
Add table
Reference in a new issue