mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
107 lines
3.3 KiB
Python
107 lines
3.3 KiB
Python
load("//Config:buck_rule_macros.bzl", "static_library", "glob_map", "glob_sub_map", "merge_maps")
|
|
|
|
replace_symbols = [
|
|
"WebRtcAgc_Process",
|
|
"rtc_FatalMessage",
|
|
"WebRtcAgc_UpdateAgcThresholds",
|
|
"WebRtcAgc_Init",
|
|
"WebRtcAgc_GetAddFarendError",
|
|
"WebRtcAgc_ZeroCtrl",
|
|
"WebRtcAgc_SaturationCtrl",
|
|
"WebRtcAgc_SpeakerInactiveCtrl",
|
|
"WebRtcAgc_ProcessAnalog",
|
|
"WebRtcAgc_set_config",
|
|
"WebRtcAgc_get_config",
|
|
"WebRtcAgc_ExpCurve",
|
|
"WebRtcAgc_Create",
|
|
"WebRtcAgc_Free",
|
|
"WebRtcAgc_AddFarend",
|
|
"WebRtcAgc_VirtualMic",
|
|
"WebRtcAgc_AddMic",
|
|
"WebRtcAgc_InitDigital",
|
|
"WebRtcAgc_AddFarendToDigital",
|
|
"WebRtcAgc_CalculateGainTable",
|
|
"WebRtcAgc_InitVad",
|
|
"WebRtcAgc_ProcessVad",
|
|
"rtc",
|
|
"webrtc",
|
|
]
|
|
|
|
shared_compiler_flags = [
|
|
"-DTGVOIP_INCLUDE_OPUS_PACKAGE",
|
|
] + ["-D{symbol}={symbol}1".format(symbol=symbol) for symbol in replace_symbols]
|
|
|
|
static_library(
|
|
name = "TgVoip",
|
|
srcs = glob([
|
|
"Sources/**/*.m",
|
|
"Sources/**/*.mm",
|
|
"Sources/**/*.h",
|
|
"libtgvoip/*.m",
|
|
"libtgvoip/*.mm",
|
|
"libtgvoip/*.cpp",
|
|
"libtgvoip/audio/*.cpp",
|
|
"libtgvoip/video/*.cpp",
|
|
"libtgvoip/os/darwin/*.m",
|
|
"libtgvoip/os/darwin/*.mm",
|
|
"libtgvoip/os/darwin/*.cpp",
|
|
"libtgvoip/os/posix/*.cpp",
|
|
"libtgvoip/webrtc_dsp/**/*.c",
|
|
"libtgvoip/webrtc_dsp/**/*.cc",
|
|
"libtgvoip/webrtc_dsp/**/*.cpp",
|
|
], exclude = ["libtgvoip/os/darwin/*OSX*"]),
|
|
has_cpp = True,
|
|
headers = merge_maps([
|
|
glob_sub_map("libtgvoip/", [
|
|
"libtgvoip/*.h",
|
|
"libtgvoip/*.hpp",
|
|
"libtgvoip/audio/*.h",
|
|
"libtgvoip/audio/*.hpp",
|
|
"libtgvoip/video/*.h",
|
|
"libtgvoip/video/*.hpp",
|
|
]),
|
|
glob_sub_map("libtgvoip/", [
|
|
"libtgvoip/os/darwin/*.h",
|
|
], exclude = ["libtgvoip/os/darwin/*OSX*"]),
|
|
glob_sub_map("libtgvoip/webrtc_dsp/", [
|
|
"libtgvoip/webrtc_dsp/**/*.h",
|
|
]),
|
|
]),
|
|
exported_headers = glob([
|
|
"PublicHeaders/**/*.h",
|
|
]),
|
|
platform_compiler_flags = [
|
|
('arm.*', [
|
|
'-DTGVOIP_USE_CUSTOM_CRYPTO',
|
|
'-DTGVOIP_USE_INSTALLED_OPUS',
|
|
'-DWEBRTC_APM_DEBUG_DUMP=0',
|
|
'-DWEBRTC_POSIX',
|
|
'-DTGVOIP_HAVE_TGLOG',
|
|
'-DWEBRTC_NS_FLOAT',
|
|
'-DWEBRTC_IOS',
|
|
'-DWEBRTC_HAS_NEON',
|
|
] + shared_compiler_flags),
|
|
('.*', [
|
|
'-DTGVOIP_USE_CUSTOM_CRYPTO',
|
|
'-DTGVOIP_USE_INSTALLED_OPUS',
|
|
'-DWEBRTC_APM_DEBUG_DUMP=0',
|
|
'-DWEBRTC_POSIX',
|
|
'-DTGVOIP_HAVE_TGLOG',
|
|
'-DWEBRTC_NS_FLOAT',
|
|
'-DWEBRTC_IOS',
|
|
] + shared_compiler_flags),
|
|
],
|
|
deps = [
|
|
"//submodules/MtProtoKit:MtProtoKit#shared",
|
|
"//submodules/Opus:opus",
|
|
],
|
|
frameworks = [
|
|
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
|
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
|
"$SDKROOT/System/Library/Frameworks/AudioToolbox.framework",
|
|
"$SDKROOT/System/Library/Frameworks/VideoToolbox.framework",
|
|
"$SDKROOT/System/Library/Frameworks/CoreTelephony.framework",
|
|
"$SDKROOT/System/Library/Frameworks/CoreMedia.framework",
|
|
"$SDKROOT/System/Library/Frameworks/AVFoundation.framework",
|
|
],
|
|
) |