mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Build with both systems
This commit is contained in:
parent
763876773c
commit
e2fda3f9ef
13 changed files with 197 additions and 55 deletions
8
third-party/BUCK
vendored
8
third-party/BUCK
vendored
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
filegroup(
|
||||
name = "depot_tools_sources",
|
||||
srcs = glob([
|
||||
"depot_tools/**/*"
|
||||
]),
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
||||
65
third-party/webrtc/BUCK
vendored
Normal file
65
third-party/webrtc/BUCK
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
load("//Config:buck_rule_macros.bzl", "static_library")
|
||||
|
||||
webrtc_lib_flags = [
|
||||
"-lwebrtc"
|
||||
]
|
||||
|
||||
genrule(
|
||||
name = "webrtc_build",
|
||||
srcs = [
|
||||
"build-webrtc-buck.sh",
|
||||
"webrtc-ios",
|
||||
"patch.sh",
|
||||
],
|
||||
bash =
|
||||
"""
|
||||
set -x
|
||||
echo "SRCDIR=$SRCDIR"
|
||||
|
||||
OUT_DIR="ios"
|
||||
|
||||
BUILD_ARCH=arm64
|
||||
|
||||
BUILD_DIR="$SRCDIR/$BUILD_ARCH"
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
mkdir -p "$BUILD_DIR/webrtc-ios"
|
||||
cp -R "$SRCDIR/webrtc-ios/.git" "$BUILD_DIR/webrtc-ios/.git"
|
||||
cp -R "$SRCDIR/webrtc-ios/src" "$BUILD_DIR/webrtc-ios/src"
|
||||
|
||||
DEPOT_TOOLS_PATH="$(location //third-party:depot_tools_sources)"
|
||||
|
||||
rm -rf "$BUILD_DIR/depot_tools"
|
||||
cp -R "$DEPOT_TOOLS_PATH" "$BUILD_DIR/"
|
||||
|
||||
cp "$SRCDIR/patch.sh" "$BUILD_DIR/"
|
||||
|
||||
rm -rf "$BUILD_DIR/openssl"
|
||||
cp -R "$(location //submodules/openssl:openssl_build_merged)" "$BUILD_DIR/openssl/"
|
||||
cp -R "$(location //submodules/openssl:openssl_libssl_merged)" "$BUILD_DIR/libssl/"
|
||||
|
||||
sh $SRCDIR/build-webrtc-buck.sh "$BUILD_DIR" $BUILD_ARCH
|
||||
|
||||
mkdir -p "$OUT"
|
||||
cp "$BUILD_DIR/webrtc-ios/src/out/$OUT_DIR/obj/libwebrtc.a" "$OUT/"
|
||||
""",
|
||||
out = "libwebrtc",
|
||||
visibility = ["PUBLIC"]
|
||||
)
|
||||
|
||||
apple_library(
|
||||
name = "webrtc_lib",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
linker_flags = [
|
||||
"-L$(location :webrtc_build)",
|
||||
] + webrtc_lib_flags,
|
||||
exported_linker_flags = [
|
||||
"-L$(location :webrtc_build)",
|
||||
] + webrtc_lib_flags,
|
||||
deps = [
|
||||
":webrtc_build"
|
||||
],
|
||||
)
|
||||
33
third-party/webrtc/build-webrtc-buck.sh
vendored
Executable file
33
third-party/webrtc/build-webrtc-buck.sh
vendored
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#/bin/sh
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
BUILD_DIR="$1"
|
||||
ARCH="$2"
|
||||
|
||||
echo "BUILD_DIR=$BUILD_DIR"
|
||||
echo "ARCH=$ARCH"
|
||||
|
||||
export PATH="$PATH:$BUILD_DIR/depot_tools_sources/depot_tools"
|
||||
|
||||
rm -rf "$BUILD_DIR/webrtc-ios/src/openssl"
|
||||
cp -R "$BUILD_DIR/openssl" "$BUILD_DIR/webrtc-ios/src/"
|
||||
cp -R "$BUILD_DIR/libssl" "$BUILD_DIR/webrtc-ios/src/"
|
||||
|
||||
pushd "$BUILD_DIR/webrtc-ios/src"
|
||||
|
||||
mv openssl/lib/libcrypto.a openssl/
|
||||
mv libssl/lib/libssl.a openssl/
|
||||
|
||||
sh "../../patch.sh" || true
|
||||
|
||||
OUT_DIR="ios"
|
||||
if [ "$ARCH" == "x64" ]; then
|
||||
OUT_DIR="ios_sim"
|
||||
fi
|
||||
|
||||
gn gen out/$OUT_DIR --args="use_xcode_clang=true "" target_cpu=\"$ARCH\""' target_os="ios" is_debug=false is_component_build=false rtc_include_tests=false use_rtti=true rtc_use_x11=false use_custom_libcxx=false use_custom_libcxx_for_host=false rtc_include_builtin_video_codecs=false rtc_build_ssl=false rtc_build_examples=false rtc_build_tools=false ios_deployment_target="9.0" ios_enable_code_signing=false is_unsafe_developer_build=false rtc_enable_protobuf=false rtc_include_builtin_video_codecs=false rtc_use_gtk=false rtc_use_metal_rendering=false rtc_ssl_root="//openssl"'
|
||||
ninja -C out/$OUT_DIR webrtc
|
||||
|
||||
popd
|
||||
2
third-party/webrtc/webrtc-ios
vendored
2
third-party/webrtc/webrtc-ios
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 6774acc02feb905ee8209a2e187c8cc464c87289
|
||||
Subproject commit 8f607fdd6930223d8db1c8f0496c4cd3ab83be9a
|
||||
Loading…
Add table
Add a link
Reference in a new issue