Skip to content

Commit 6a59fdd

Browse files
authored
Revert "Backup/sync fork 20250309 (#9)"
This reverts commit 0bc0842.
1 parent 0bc0842 commit 6a59fdd

31 files changed

+209
-435
lines changed

.gitignore

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ bld/
2929
[Bb]in/
3030
[Oo]bj/
3131
[Ll]og/
32-
*.apk
3332

3433
# Visual Studio 2015/2017 cache/options directory
3534
.vs/
3635

37-
# VS Code
38-
.vscode/
39-
4036
# Autogenerated VS solution and project files
4137
*.csproj
4238
*.sln
@@ -219,7 +215,7 @@ _pkginfo.txt
219215
ClientBin/
220216
Bin~/
221217
upm-ci~/
222-
Plugin~/webrtc*/*
218+
Plugin~/webrtc/*
223219
WebRTC~/CodeCoverage
224220
WebRTC~/TestResults-*
225221
WebRTC~/Logs
@@ -390,5 +386,6 @@ Runtime/Plugins/x86_64/*.lib.meta
390386
Runtime/Plugins/x86_64/*.ilk.meta
391387
Runtime/Plugins/x86_64/*.pdb.meta
392388

393-
# ignore mac system file
394-
**/.DS_Store
389+
390+
391+

BuildScripts~/build_libwebrtc_android.sh

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ then
66
fi
77

88
export COMMAND_DIR=$(cd $(dirname $0); pwd)
9-
export PATH="$(pwd)/depot_tools:$(pwd)/depot_tools/python-bin:$PATH"
10-
export WEBRTC_VERSION=6367
9+
export PATH="$(pwd)/depot_tools:$PATH"
10+
export WEBRTC_VERSION=5845
1111
export OUTPUT_DIR="$(pwd)/out"
1212
export ARTIFACTS_DIR="$(pwd)/artifacts"
1313
export PYTHON3_BIN="$(pwd)/depot_tools/python-bin/python3"
@@ -23,20 +23,25 @@ then
2323
git checkout "refs/remotes/branch-heads/$WEBRTC_VERSION"
2424
cd ..
2525
gclient sync -D --force --reset
26-
else
27-
# fetch and init config on only first time
28-
cd src
29-
git checkout "refs/remotes/branch-heads/$WEBRTC_VERSION"
30-
cd ..
31-
gclient sync -D --force --reset
3226
fi
3327

3428
# Add jsoncpp
3529
patch -N "src/BUILD.gn" < "$COMMAND_DIR/patches/add_jsoncpp.patch"
3630

31+
# Add visibility libunwind
32+
patch -N "src/buildtools/third_party/libunwind/BUILD.gn" < "$COMMAND_DIR/patches/add_visibility_libunwind.patch"
33+
34+
# Add deps libunwind
35+
patch -N "src/build/config/BUILD.gn" < "$COMMAND_DIR/patches/add_deps_libunwind.patch"
36+
3737
# Add -mno-outline-atomics flag
3838
patch -N "src/build/config/compiler/BUILD.gn" < "$COMMAND_DIR/patches/add_nooutlineatomics_flag.patch"
3939

40+
# downgrade to JDK8 because Unity supports OpenJDK version 1.8.
41+
# https://docs.unity3d.com/Manual/android-sdksetup.html
42+
patch -N "src/build/android/gyp/compile_java.py" < "$COMMAND_DIR/patches/downgradeJDKto8_compile_java.patch"
43+
patch -N "src/build/android/gyp/turbine.py" < "$COMMAND_DIR/patches/downgradeJDKto8_turbine.patch"
44+
4045
# Fix SetRawImagePlanes() in LibvpxVp8Encoder
4146
patch -N "src/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc" < "$COMMAND_DIR/patches/libvpx_vp8_encoder.patch"
4247

@@ -49,84 +54,81 @@ popd
4954

5055
mkdir -p "$ARTIFACTS_DIR/lib"
5156

52-
outputDir=""
5357

5458
for target_cpu in "arm64" "x64"
5559
do
5660
mkdir -p "$ARTIFACTS_DIR/lib/${target_cpu}"
61+
5762
for is_debug in "true" "false"
5863
do
59-
outputDir="${OUTPUT_DIR}_${is_debug}_${target_cpu}"
6064
# generate ninja files
6165
# use `treat_warnings_as_errors` option to avoid deprecation warnings
62-
gn gen "$outputDir" --root="src" \
63-
--args=" \
64-
exclude_unwind_tables=true \
65-
is_component_build=false \
66-
is_debug=${is_debug} \
66+
gn gen "$OUTPUT_DIR" --root="src" \
67+
--args="is_debug=${is_debug} \
6768
is_java_debug=${is_debug} \
69+
target_os=\"android\" \
70+
target_cpu=\"${target_cpu}\" \
6871
rtc_use_h264=false \
6972
rtc_include_tests=false \
7073
rtc_build_examples=false \
71-
rtc_build_tools=false \
72-
target_os=\"android\" \
73-
target_cpu=\"${target_cpu}\" \
74-
treat_warnings_as_errors=false \
74+
is_component_build=false \
7575
use_rtti=true \
76-
use_errorprone_java_compiler=false"
76+
use_custom_libcxx=false \
77+
treat_warnings_as_errors=false \
78+
use_errorprone_java_compiler=false \
79+
use_cxx17=true"
7780

7881
# build static library
79-
ninja -C "$outputDir" webrtc
82+
ninja -C "$OUTPUT_DIR" webrtc
8083

8184
filename="libwebrtc.a"
8285
if [ $is_debug = "true" ]; then
8386
filename="libwebrtcd.a"
8487
fi
8588

8689
# copy static library
87-
cp "$outputDir/obj/libwebrtc.a" "$ARTIFACTS_DIR/lib/${target_cpu}/${filename}"
90+
cp "$OUTPUT_DIR/obj/libwebrtc.a" "$ARTIFACTS_DIR/lib/${target_cpu}/${filename}"
8891
done
8992
done
9093

9194
pushd src
9295

9396
for is_debug in "true" "false"
9497
do
95-
aarOutputDir="${OUTPUT_DIR}_${is_debug}_aar"
9698
# use `treat_warnings_as_errors` option to avoid deprecation warnings
9799
"$PYTHON3_BIN" tools_webrtc/android/build_aar.py \
98-
--build-dir $aarOutputDir \
99-
--output $aarOutputDir/libwebrtc.aar \
100+
--build-dir $OUTPUT_DIR \
101+
--output $OUTPUT_DIR/libwebrtc.aar \
100102
--arch arm64-v8a x86_64 \
101-
--extra-gn-args " \
102-
is_debug=${is_debug} \
103+
--extra-gn-args "is_debug=${is_debug} \
103104
is_java_debug=${is_debug} \
104-
is_component_build=false \
105105
rtc_use_h264=false \
106106
rtc_include_tests=false \
107107
rtc_build_examples=false \
108-
rtc_build_tools=false \
109-
treat_warnings_as_errors=false \
108+
is_component_build=false \
110109
use_rtti=true \
111-
use_errorprone_java_compiler=false"
110+
use_custom_libcxx=false \
111+
treat_warnings_as_errors=false \
112+
use_errorprone_java_compiler=false \
113+
use_cxx17=true"
112114

113115
filename="libwebrtc.aar"
114116
if [ $is_debug = "true" ]; then
115117
filename="libwebrtc-debug.aar"
116118
fi
117119
# copy aar
118-
cp "$aarOutputDir/libwebrtc.aar" "$ARTIFACTS_DIR/lib/${filename}"
120+
cp "$OUTPUT_DIR/libwebrtc.aar" "$ARTIFACTS_DIR/lib/${filename}"
119121
done
120122

121123
popd
122124

123125
"$PYTHON3_BIN" "./src/tools_webrtc/libs/generate_licenses.py" \
124-
--target :webrtc "$outputDir" "$outputDir"
126+
--target :webrtc "$OUTPUT_DIR" "$OUTPUT_DIR"
125127

126128
cd src
127129
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
128130

129-
cp "$outputDir/LICENSE.md" "$ARTIFACTS_DIR"
131+
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
130132

131133
# create zip
132134
cd "$ARTIFACTS_DIR"

BuildScripts~/build_libwebrtc_ios.sh

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ then
66
fi
77

88
export COMMAND_DIR=$(cd $(dirname $0); pwd)
9-
export PATH="$(pwd)/depot_tools:$(pwd)/depot_tools/python-bin:$PATH"
10-
export WEBRTC_VERSION=6367
9+
export PATH="$(pwd)/depot_tools:$PATH"
10+
export WEBRTC_VERSION=5845
1111
export OUTPUT_DIR="$(pwd)/out"
1212
export ARTIFACTS_DIR="$(pwd)/artifacts"
1313
export PYTHON3_BIN="$(pwd)/depot_tools/python-bin/python3"
@@ -21,63 +21,55 @@ then
2121
git checkout "refs/remotes/branch-heads/$WEBRTC_VERSION"
2222
cd ..
2323
gclient sync -D --force --reset
24-
else
25-
# fetch and init config on only first time
26-
cd src
27-
git checkout "refs/remotes/branch-heads/$WEBRTC_VERSION"
28-
cd ..
29-
gclient sync -D --force --reset
3024
fi
3125

3226
# add jsoncpp
3327
patch -N "src/BUILD.gn" < "$COMMAND_DIR/patches/add_jsoncpp.patch"
3428

3529
# disable GCD taskqueue, use stdlib taskqueue instead
3630
# This is because GCD cannot measure with UnityProfiler
37-
# patch -N "src/api/task_queue/BUILD.gn" < "$COMMAND_DIR/patches/disable_task_queue_gcd.patch"
31+
patch -N "src/api/task_queue/BUILD.gn" < "$COMMAND_DIR/patches/disable_task_queue_gcd.patch"
3832

3933
# add objc library to use videotoolbox
4034
patch -N "src/sdk/BUILD.gn" < "$COMMAND_DIR/patches/add_objc_deps.patch"
4135

4236
# Fix SetRawImagePlanes() in LibvpxVp8Encoder
4337
patch -N "src/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc" < "$COMMAND_DIR/patches/libvpx_vp8_encoder.patch"
4438

45-
mkdir -p "$ARTIFACTS_DIR/lib"
39+
# use included python
40+
export PATH="$(pwd)/depot_tools/bootstrap-3.8.0.chromium.8_bin/python/bin:$PATH"
4641

47-
outputDir=""
42+
mkdir -p "$ARTIFACTS_DIR/lib"
4843

4944
for is_debug in "true" "false"
5045
do
5146
for target_cpu in "arm64" "x64"
5247
do
53-
outputDir="${OUTPUT_DIR}_${is_debug}_${target_cpu}"
5448
# generate ninja files
5549
#
5650
# note: `treat_warnings_as_errors=false` is for avoiding LLVM warning.
5751
# https://reviews.llvm.org/D72212
5852
# See below for details.
5953
# https://bugs.chromium.org/p/webrtc/issues/detail?id=11729
6054
#
61-
gn gen "$outputDir" --root="src" \
62-
--args=" \
63-
is_debug=${is_debug} \
64-
is_component_build=false \
65-
ios_enable_code_signing=false \
55+
gn gen "$OUTPUT_DIR" --root="src" \
56+
--args="is_debug=${is_debug} \
6657
target_os=\"ios\" \
6758
target_cpu=\"${target_cpu}\" \
68-
treat_warnings_as_errors=false \
6959
rtc_use_h264=false \
60+
use_custom_libcxx=false \
61+
treat_warnings_as_errors=false \
62+
ios_enable_code_signing=false \
7063
rtc_include_tests=false \
7164
rtc_build_examples=false \
72-
rtc_build_tools=false \
73-
use_custom_libcxx=false"
74-
65+
use_cxx17=true"
66+
7567
# build static library
76-
ninja -C "$outputDir" webrtc
68+
ninja -C "$OUTPUT_DIR" webrtc
7769

7870
# copy static library
7971
mkdir -p "$ARTIFACTS_DIR/lib/${target_cpu}"
80-
cp "$outputDir/obj/libwebrtc.a" "$ARTIFACTS_DIR/lib/${target_cpu}/"
72+
cp "$OUTPUT_DIR/obj/libwebrtc.a" "$ARTIFACTS_DIR/lib/${target_cpu}/"
8173
done
8274

8375
filename="libwebrtc.a"
@@ -96,12 +88,12 @@ do
9688
done
9789

9890
"$PYTHON3_BIN" "./src/tools_webrtc/libs/generate_licenses.py" \
99-
--target :webrtc "$outputDir" "$outputDir"
91+
--target :webrtc "$OUTPUT_DIR" "$OUTPUT_DIR"
10092

10193
cd src
10294
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
10395

104-
cp "$outputDir/LICENSE.md" "$ARTIFACTS_DIR"
96+
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
10597

10698
# create zip
10799
cd "$ARTIFACTS_DIR"

BuildScripts~/build_libwebrtc_linux.sh

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ then
66
fi
77

88
export COMMAND_DIR=$(cd $(dirname $0); pwd)
9-
export PATH="$(pwd)/depot_tools:$(pwd)/depot_tools/python-bin:$PATH"
10-
export WEBRTC_VERSION=6367
9+
export PATH="$(pwd)/depot_tools:$PATH"
10+
export WEBRTC_VERSION=5845
1111
export OUTPUT_DIR="$(pwd)/out"
1212
export ARTIFACTS_DIR="$(pwd)/artifacts"
1313
export PYTHON3_BIN="$(pwd)/depot_tools/python-bin/python3"
@@ -21,12 +21,6 @@ then
2121
git checkout "refs/remotes/branch-heads/$WEBRTC_VERSION"
2222
cd ..
2323
gclient sync -D --force --reset
24-
else
25-
# fetch and init config on only first time
26-
cd src
27-
git checkout "refs/remotes/branch-heads/$WEBRTC_VERSION"
28-
cd ..
29-
gclient sync -D --force --reset
3024
fi
3125

3226
# add jsoncpp
@@ -37,57 +31,52 @@ patch -N "src/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc" < "$COMMAND
3731

3832
mkdir -p "$ARTIFACTS_DIR/lib"
3933

40-
outputDir=""
41-
4234
for target_cpu in "x64"
4335
do
4436
mkdir -p "$ARTIFACTS_DIR/lib/${target_cpu}"
4537
for is_debug in "true" "false"
4638
do
47-
outputDir="${OUTPUT_DIR}_${is_debug}_${target_cpu}"
48-
# use_custom_libcxx=false is failed because install sysroot does not supoort c++11
49-
args=" \
50-
enable_iterator_debugging=false \
51-
is_component_build=false \
52-
is_debug=${is_debug} \
39+
args="is_debug=${is_debug} \
40+
target_os=\"linux\" \
41+
target_cpu=\"${target_cpu}\" \
42+
use_custom_libcxx=false \
5343
rtc_include_tests=false \
5444
rtc_build_examples=false \
55-
rtc_build_tools=false \
5645
rtc_use_h264=false \
57-
rtc_use_x11=false \
5846
symbol_level=0 \
59-
target_os=\"linux\" \
60-
target_cpu=\"${target_cpu}\" \
61-
use_custom_libcxx=true \
62-
use_rtti=true"
47+
enable_iterator_debugging=false \
48+
is_component_build=false \
49+
use_rtti=true \
50+
rtc_use_x11=false \
51+
use_cxx17=true"
6352

6453
if [ $is_debug = "true" ]; then
6554
args="${args} is_asan=true is_lsan=true";
6655
fi
6756

6857
# generate ninja files
69-
gn gen "$outputDir" --root="src" --args="${args}"
58+
gn gen "$OUTPUT_DIR" --root="src" --args="${args}"
7059

7160
# build static library
72-
ninja -C "$outputDir" webrtc
61+
ninja -C "$OUTPUT_DIR" webrtc
7362

7463
filename="libwebrtc.a"
7564
if [ $is_debug = "true" ]; then
7665
filename="libwebrtcd.a"
7766
fi
7867

7968
# cppy static library
80-
cp "$outputDir/obj/libwebrtc.a" "$ARTIFACTS_DIR/lib/${target_cpu}/${filename}"
69+
cp "$OUTPUT_DIR/obj/libwebrtc.a" "$ARTIFACTS_DIR/lib/${target_cpu}/${filename}"
8170
done
8271
done
8372

84-
$PYTHON3_BIN "./src/tools_webrtc/libs/generate_licenses.py" \
85-
--target :webrtc "$outputDir" "$outputDir"
73+
"$PYTHON3_BIN" "./src/tools_webrtc/libs/generate_licenses.py" \
74+
--target :webrtc "$OUTPUT_DIR" "$OUTPUT_DIR"
8675

8776
cd src
8877
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
8978

90-
cp "$outputDir/LICENSE.md" "$ARTIFACTS_DIR"
79+
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
9180

9281
# create zip
9382
cd "$ARTIFACTS_DIR"

0 commit comments

Comments
 (0)