mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use return to decrease indentation in cmake files
This commit is contained in:
parent
f1244e19a1
commit
7c8d10022f
1 changed files with 183 additions and 184 deletions
|
@ -13,209 +13,208 @@ if (DESKTOP_APP_USE_PACKAGED)
|
||||||
|
|
||||||
if (TGVOIP_FOUND)
|
if (TGVOIP_FOUND)
|
||||||
target_link_libraries(lib_tgvoip INTERFACE PkgConfig::TGVOIP)
|
target_link_libraries(lib_tgvoip INTERFACE PkgConfig::TGVOIP)
|
||||||
|
return()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT TGVOIP_FOUND)
|
add_library(lib_tgvoip_bundled STATIC)
|
||||||
add_library(lib_tgvoip_bundled STATIC)
|
init_target(lib_tgvoip_bundled)
|
||||||
init_target(lib_tgvoip_bundled)
|
|
||||||
|
|
||||||
option(LIBTGVOIP_DISABLE_ALSA "Disable libtgvoip's ALSA backend (Linux only)." OFF)
|
option(LIBTGVOIP_DISABLE_ALSA "Disable libtgvoip's ALSA backend (Linux only)." OFF)
|
||||||
option(LIBTGVOIP_DISABLE_PULSEAUDIO "Disable libtgvoip's PulseAudio backend (Linux only)." OFF)
|
option(LIBTGVOIP_DISABLE_PULSEAUDIO "Disable libtgvoip's PulseAudio backend (Linux only)." OFF)
|
||||||
|
|
||||||
set(tgvoip_loc ${third_party_loc}/libtgvoip)
|
set(tgvoip_loc ${third_party_loc}/libtgvoip)
|
||||||
|
|
||||||
nice_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
nice_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
BlockingQueue.cpp
|
BlockingQueue.cpp
|
||||||
BlockingQueue.h
|
BlockingQueue.h
|
||||||
Buffers.cpp
|
Buffers.cpp
|
||||||
Buffers.h
|
Buffers.h
|
||||||
CongestionControl.cpp
|
CongestionControl.cpp
|
||||||
CongestionControl.h
|
CongestionControl.h
|
||||||
EchoCanceller.cpp
|
EchoCanceller.cpp
|
||||||
EchoCanceller.h
|
EchoCanceller.h
|
||||||
JitterBuffer.cpp
|
JitterBuffer.cpp
|
||||||
JitterBuffer.h
|
JitterBuffer.h
|
||||||
logging.cpp
|
logging.cpp
|
||||||
logging.h
|
logging.h
|
||||||
MediaStreamItf.cpp
|
MediaStreamItf.cpp
|
||||||
MediaStreamItf.h
|
MediaStreamItf.h
|
||||||
OpusDecoder.cpp
|
OpusDecoder.cpp
|
||||||
OpusDecoder.h
|
OpusDecoder.h
|
||||||
OpusEncoder.cpp
|
OpusEncoder.cpp
|
||||||
OpusEncoder.h
|
OpusEncoder.h
|
||||||
threading.h
|
threading.h
|
||||||
VoIPController.cpp
|
VoIPController.cpp
|
||||||
VoIPGroupController.cpp
|
VoIPGroupController.cpp
|
||||||
VoIPController.h
|
VoIPController.h
|
||||||
PrivateDefines.h
|
PrivateDefines.h
|
||||||
VoIPServerConfig.cpp
|
VoIPServerConfig.cpp
|
||||||
VoIPServerConfig.h
|
VoIPServerConfig.h
|
||||||
audio/AudioInput.cpp
|
audio/AudioInput.cpp
|
||||||
audio/AudioInput.h
|
audio/AudioInput.h
|
||||||
audio/AudioOutput.cpp
|
audio/AudioOutput.cpp
|
||||||
audio/AudioOutput.h
|
audio/AudioOutput.h
|
||||||
audio/Resampler.cpp
|
audio/Resampler.cpp
|
||||||
audio/Resampler.h
|
audio/Resampler.h
|
||||||
NetworkSocket.cpp
|
NetworkSocket.cpp
|
||||||
NetworkSocket.h
|
NetworkSocket.h
|
||||||
PacketReassembler.cpp
|
PacketReassembler.cpp
|
||||||
PacketReassembler.h
|
PacketReassembler.h
|
||||||
MessageThread.cpp
|
MessageThread.cpp
|
||||||
MessageThread.h
|
MessageThread.h
|
||||||
audio/AudioIO.cpp
|
audio/AudioIO.cpp
|
||||||
audio/AudioIO.h
|
audio/AudioIO.h
|
||||||
video/ScreamCongestionController.cpp
|
video/ScreamCongestionController.cpp
|
||||||
video/ScreamCongestionController.h
|
video/ScreamCongestionController.h
|
||||||
video/VideoSource.cpp
|
video/VideoSource.cpp
|
||||||
video/VideoSource.h
|
video/VideoSource.h
|
||||||
video/VideoRenderer.cpp
|
video/VideoRenderer.cpp
|
||||||
video/VideoRenderer.h
|
video/VideoRenderer.h
|
||||||
json11.cpp
|
json11.cpp
|
||||||
json11.hpp
|
json11.hpp
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
os/windows/NetworkSocketWinsock.cpp
|
os/windows/NetworkSocketWinsock.cpp
|
||||||
os/windows/NetworkSocketWinsock.h
|
os/windows/NetworkSocketWinsock.h
|
||||||
os/windows/AudioInputWave.cpp
|
os/windows/AudioInputWave.cpp
|
||||||
os/windows/AudioInputWave.h
|
os/windows/AudioInputWave.h
|
||||||
os/windows/AudioOutputWave.cpp
|
os/windows/AudioOutputWave.cpp
|
||||||
os/windows/AudioOutputWave.h
|
os/windows/AudioOutputWave.h
|
||||||
os/windows/AudioOutputWASAPI.cpp
|
os/windows/AudioOutputWASAPI.cpp
|
||||||
os/windows/AudioOutputWASAPI.h
|
os/windows/AudioOutputWASAPI.h
|
||||||
os/windows/AudioInputWASAPI.cpp
|
os/windows/AudioInputWASAPI.cpp
|
||||||
os/windows/AudioInputWASAPI.h
|
os/windows/AudioInputWASAPI.h
|
||||||
os/windows/MinGWSupport.h
|
os/windows/MinGWSupport.h
|
||||||
os/windows/WindowsSpecific.cpp
|
os/windows/WindowsSpecific.cpp
|
||||||
os/windows/WindowsSpecific.h
|
os/windows/WindowsSpecific.h
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
os/darwin/AudioInputAudioUnit.cpp
|
os/darwin/AudioInputAudioUnit.cpp
|
||||||
os/darwin/AudioInputAudioUnit.h
|
os/darwin/AudioInputAudioUnit.h
|
||||||
os/darwin/AudioOutputAudioUnit.cpp
|
os/darwin/AudioOutputAudioUnit.cpp
|
||||||
os/darwin/AudioOutputAudioUnit.h
|
os/darwin/AudioOutputAudioUnit.h
|
||||||
os/darwin/AudioInputAudioUnitOSX.cpp
|
os/darwin/AudioInputAudioUnitOSX.cpp
|
||||||
os/darwin/AudioInputAudioUnitOSX.h
|
os/darwin/AudioInputAudioUnitOSX.h
|
||||||
os/darwin/AudioOutputAudioUnitOSX.cpp
|
os/darwin/AudioOutputAudioUnitOSX.cpp
|
||||||
os/darwin/AudioOutputAudioUnitOSX.h
|
os/darwin/AudioOutputAudioUnitOSX.h
|
||||||
os/darwin/AudioUnitIO.cpp
|
os/darwin/AudioUnitIO.cpp
|
||||||
os/darwin/AudioUnitIO.h
|
os/darwin/AudioUnitIO.h
|
||||||
os/darwin/DarwinSpecific.mm
|
os/darwin/DarwinSpecific.mm
|
||||||
os/darwin/DarwinSpecific.h
|
os/darwin/DarwinSpecific.h
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
os/linux/AudioInputALSA.cpp
|
os/linux/AudioInputALSA.cpp
|
||||||
os/linux/AudioInputALSA.h
|
os/linux/AudioInputALSA.h
|
||||||
os/linux/AudioOutputALSA.cpp
|
os/linux/AudioOutputALSA.cpp
|
||||||
os/linux/AudioOutputALSA.h
|
os/linux/AudioOutputALSA.h
|
||||||
os/linux/AudioOutputPulse.cpp
|
os/linux/AudioOutputPulse.cpp
|
||||||
os/linux/AudioOutputPulse.h
|
os/linux/AudioOutputPulse.h
|
||||||
os/linux/AudioInputPulse.cpp
|
os/linux/AudioInputPulse.cpp
|
||||||
os/linux/AudioInputPulse.h
|
os/linux/AudioInputPulse.h
|
||||||
os/linux/AudioPulse.cpp
|
os/linux/AudioPulse.cpp
|
||||||
os/linux/AudioPulse.h
|
os/linux/AudioPulse.h
|
||||||
|
|
||||||
# POSIX
|
# POSIX
|
||||||
os/posix/NetworkSocketPosix.cpp
|
os/posix/NetworkSocketPosix.cpp
|
||||||
os/posix/NetworkSocketPosix.h
|
os/posix/NetworkSocketPosix.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(lib_tgvoip_bundled
|
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_bundled
|
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_bundled
|
|
||||||
PUBLIC
|
|
||||||
# Doesn't build with mingw for now
|
|
||||||
TGVOIP_NO_DSP
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
elseif (APPLE)
|
|
||||||
target_compile_definitions(lib_tgvoip_bundled
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
TARGET_OS_OSX
|
# Doesn't build with mingw for now
|
||||||
TARGET_OSX
|
TGVOIP_NO_DSP
|
||||||
)
|
|
||||||
if (build_macstore)
|
|
||||||
target_compile_definitions(lib_tgvoip_bundled
|
|
||||||
PUBLIC
|
|
||||||
TGVOIP_NO_OSX_PRIVATE_API
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
add_library(lib_tgvoip_bundled_options INTERFACE)
|
|
||||||
target_compile_options(lib_tgvoip_bundled_options
|
|
||||||
INTERFACE
|
|
||||||
-Wno-unused-variable
|
|
||||||
-Wno-unknown-pragmas
|
|
||||||
-Wno-error=sequence-point
|
|
||||||
-Wno-error=unused-result
|
|
||||||
)
|
|
||||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
|
|
||||||
target_compile_options(lib_tgvoip_bundled_options INTERFACE -msse2)
|
|
||||||
endif()
|
|
||||||
target_link_libraries(lib_tgvoip_bundled
|
|
||||||
PRIVATE
|
|
||||||
lib_tgvoip_bundled_options
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
elseif (APPLE)
|
||||||
target_include_directories(lib_tgvoip_bundled
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${tgvoip_loc}
|
TARGET_OS_OSX
|
||||||
|
TARGET_OSX
|
||||||
)
|
)
|
||||||
|
if (build_macstore)
|
||||||
|
target_compile_definitions(lib_tgvoip_bundled
|
||||||
|
PUBLIC
|
||||||
|
TGVOIP_NO_OSX_PRIVATE_API
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_library(lib_tgvoip_bundled_options INTERFACE)
|
||||||
|
target_compile_options(lib_tgvoip_bundled_options
|
||||||
|
INTERFACE
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-unknown-pragmas
|
||||||
|
-Wno-error=sequence-point
|
||||||
|
-Wno-error=unused-result
|
||||||
|
)
|
||||||
|
if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
|
||||||
|
target_compile_options(lib_tgvoip_bundled_options INTERFACE -msse2)
|
||||||
|
endif()
|
||||||
target_link_libraries(lib_tgvoip_bundled
|
target_link_libraries(lib_tgvoip_bundled
|
||||||
PRIVATE
|
PRIVATE
|
||||||
desktop-app::external_webrtc
|
lib_tgvoip_bundled_options
|
||||||
desktop-app::external_opus
|
|
||||||
)
|
|
||||||
|
|
||||||
if (LINUX)
|
|
||||||
if (NOT LIBTGVOIP_DISABLE_ALSA)
|
|
||||||
find_package(ALSA REQUIRED)
|
|
||||||
target_include_directories(lib_tgvoip_bundled SYSTEM PRIVATE ${ALSA_INCLUDE_DIRS})
|
|
||||||
else()
|
|
||||||
remove_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
|
||||||
os/linux/AudioInputALSA.cpp
|
|
||||||
os/linux/AudioInputALSA.h
|
|
||||||
os/linux/AudioOutputALSA.cpp
|
|
||||||
os/linux/AudioOutputALSA.h
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_definitions(lib_tgvoip_bundled PRIVATE WITHOUT_ALSA)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT LIBTGVOIP_DISABLE_PULSEAUDIO)
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(PULSE REQUIRED libpulse)
|
|
||||||
target_include_directories(lib_tgvoip_bundled SYSTEM PRIVATE ${PULSE_INCLUDE_DIRS})
|
|
||||||
else()
|
|
||||||
remove_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
|
||||||
os/linux/AudioOutputPulse.cpp
|
|
||||||
os/linux/AudioOutputPulse.h
|
|
||||||
os/linux/AudioInputPulse.cpp
|
|
||||||
os/linux/AudioInputPulse.h
|
|
||||||
os/linux/AudioPulse.cpp
|
|
||||||
os/linux/AudioPulse.h
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_definitions(lib_tgvoip_bundled PRIVATE WITHOUT_PULSE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(lib_tgvoip
|
|
||||||
INTERFACE
|
|
||||||
lib_tgvoip_bundled
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(lib_tgvoip_bundled
|
||||||
|
PUBLIC
|
||||||
|
${tgvoip_loc}
|
||||||
|
)
|
||||||
|
target_link_libraries(lib_tgvoip_bundled
|
||||||
|
PRIVATE
|
||||||
|
desktop-app::external_webrtc
|
||||||
|
desktop-app::external_opus
|
||||||
|
)
|
||||||
|
|
||||||
|
if (LINUX)
|
||||||
|
if (NOT LIBTGVOIP_DISABLE_ALSA)
|
||||||
|
find_package(ALSA REQUIRED)
|
||||||
|
target_include_directories(lib_tgvoip_bundled SYSTEM PRIVATE ${ALSA_INCLUDE_DIRS})
|
||||||
|
else()
|
||||||
|
remove_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||||
|
os/linux/AudioInputALSA.cpp
|
||||||
|
os/linux/AudioInputALSA.h
|
||||||
|
os/linux/AudioOutputALSA.cpp
|
||||||
|
os/linux/AudioOutputALSA.h
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(lib_tgvoip_bundled PRIVATE WITHOUT_ALSA)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT LIBTGVOIP_DISABLE_PULSEAUDIO)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(PULSE REQUIRED libpulse)
|
||||||
|
target_include_directories(lib_tgvoip_bundled SYSTEM PRIVATE ${PULSE_INCLUDE_DIRS})
|
||||||
|
else()
|
||||||
|
remove_target_sources(lib_tgvoip_bundled ${tgvoip_loc}
|
||||||
|
os/linux/AudioOutputPulse.cpp
|
||||||
|
os/linux/AudioOutputPulse.h
|
||||||
|
os/linux/AudioInputPulse.cpp
|
||||||
|
os/linux/AudioInputPulse.h
|
||||||
|
os/linux/AudioPulse.cpp
|
||||||
|
os/linux/AudioPulse.h
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(lib_tgvoip_bundled PRIVATE WITHOUT_PULSE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(lib_tgvoip
|
||||||
|
INTERFACE
|
||||||
|
lib_tgvoip_bundled
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue