mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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:
|
# For license and copyright information please follow this link:
|
||||||
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
# 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(lib_tgvoip INTERFACE IMPORTED GLOBAL)
|
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
||||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
|
||||||
|
|
||||||
|
if (DESKTOP_APP_USE_PACKAGED)
|
||||||
find_package(PkgConfig REQUIRED)
|
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)
|
if (TGVOIP_FOUND)
|
||||||
else()
|
target_link_libraries(lib_tgvoip INTERFACE PkgConfig::TGVOIP)
|
||||||
add_library(lib_tgvoip STATIC)
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT TGVOIP_FOUND)
|
||||||
|
add_library(lib_tgvoip_bundled STATIC)
|
||||||
|
|
||||||
if (LINUX)
|
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()
|
else()
|
||||||
init_target(lib_tgvoip cxx_std_14)
|
init_target(lib_tgvoip_bundled cxx_std_14)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
|
||||||
|
|
||||||
set(tgvoip_loc ${third_party_loc}/libtgvoip)
|
set(tgvoip_loc ${third_party_loc}/libtgvoip)
|
||||||
|
|
||||||
nice_target_sources(lib_tgvoip ${tgvoip_loc}
|
nice_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
BlockingQueue.cpp
|
BlockingQueue.cpp
|
||||||
BlockingQueue.h
|
BlockingQueue.h
|
||||||
|
@ -121,68 +123,68 @@ else()
|
||||||
os/posix/NetworkSocketPosix.h
|
os/posix/NetworkSocketPosix.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
TGVOIP_USE_DESKTOP_DSP
|
TGVOIP_USE_DESKTOP_DSP
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
target_compile_options(lib_tgvoip
|
target_compile_options(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
/wd4005
|
/wd4005
|
||||||
/wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc)
|
/wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc)
|
||||||
/wd5055 # operator '>' deprecated between enumerations and floating-point types
|
/wd5055 # operator '>' deprecated between enumerations and floating-point types
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
# Doesn't build with mingw for now
|
# Doesn't build with mingw for now
|
||||||
TGVOIP_NO_DSP
|
TGVOIP_NO_DSP
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
TARGET_OS_OSX
|
TARGET_OS_OSX
|
||||||
TARGET_OSX
|
TARGET_OSX
|
||||||
)
|
)
|
||||||
if (build_macstore)
|
if (build_macstore)
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
TGVOIP_NO_OSX_PRIVATE_API
|
TGVOIP_NO_OSX_PRIVATE_API
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
target_compile_options(lib_tgvoip
|
target_compile_options(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
-Wno-unknown-pragmas
|
-Wno-unknown-pragmas
|
||||||
-Wno-error=sequence-point
|
-Wno-error=sequence-point
|
||||||
-Wno-error=unused-result
|
-Wno-error=unused-result
|
||||||
)
|
)
|
||||||
if (build_linux32 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(lib_tgvoip
|
target_include_directories(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${tgvoip_loc}
|
${tgvoip_loc}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION)
|
if (DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION)
|
||||||
target_include_directories(lib_tgvoip
|
target_include_directories(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${tgvoip_loc}/webrtc_dsp
|
${tgvoip_loc}/webrtc_dsp
|
||||||
)
|
)
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
TGVOIP_USE_DESKTOP_DSP_BUNDLED
|
TGVOIP_USE_DESKTOP_DSP_BUNDLED
|
||||||
WEBRTC_APM_DEBUG_DUMP=0
|
WEBRTC_APM_DEBUG_DUMP=0
|
||||||
WEBRTC_NS_FLOAT
|
WEBRTC_NS_FLOAT
|
||||||
)
|
)
|
||||||
|
|
||||||
nice_target_sources(lib_tgvoip ${tgvoip_loc}
|
nice_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
# WebRTC APM
|
# WebRTC APM
|
||||||
webrtc_dsp/system_wrappers/include/field_trial.h
|
webrtc_dsp/system_wrappers/include/field_trial.h
|
||||||
|
@ -791,18 +793,18 @@ else()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
WEBRTC_WIN
|
WEBRTC_WIN
|
||||||
)
|
)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
WEBRTC_POSIX
|
WEBRTC_POSIX
|
||||||
WEBRTC_MAC
|
WEBRTC_MAC
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(lib_tgvoip
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
WEBRTC_POSIX
|
WEBRTC_POSIX
|
||||||
WEBRTC_LINUX
|
WEBRTC_LINUX
|
||||||
|
@ -810,13 +812,13 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
target_link_libraries(lib_tgvoip
|
target_link_libraries(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
desktop-app::external_webrtc
|
desktop-app::external_webrtc
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(lib_tgvoip
|
target_link_libraries(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
desktop-app::external_opus
|
desktop-app::external_opus
|
||||||
)
|
)
|
||||||
|
@ -826,16 +828,21 @@ else()
|
||||||
pkg_check_modules(ALSA REQUIRED alsa)
|
pkg_check_modules(ALSA REQUIRED alsa)
|
||||||
pkg_check_modules(PULSE REQUIRED libpulse)
|
pkg_check_modules(PULSE REQUIRED libpulse)
|
||||||
|
|
||||||
target_include_directories(lib_tgvoip
|
target_include_directories(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${ALSA_INCLUDE_DIRS}
|
${ALSA_INCLUDE_DIRS}
|
||||||
${PULSE_INCLUDE_DIRS}
|
${PULSE_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(lib_tgvoip
|
target_link_libraries(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_DL_LIBS}
|
${CMAKE_DL_LIBS}
|
||||||
pthread
|
pthread
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(lib_tgvoip
|
||||||
|
INTERFACE
|
||||||
|
lib_tgvoip_bundled
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
option(TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME "Disable automatic 'tg://' URL scheme handler registration." OFF)
|
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_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_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)
|
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_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.")
|
set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.")
|
||||||
|
|
Loading…
Add table
Reference in a new issue