Skip to content

Commit 23f88d5

Browse files
committed
Build GN manually to support i386 builds
1 parent fb8dc20 commit 23f88d5

File tree

5 files changed

+45
-4
lines changed

5 files changed

+45
-4
lines changed

webrtc/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ if(NOT ${get_webrtc_source_result} EQUAL 0)
3131
message(FATAL_ERROR "cannot update WebRTC source code")
3232
endif()
3333

34+
message(STATUS "Fetching latest GN build tool from Google")
35+
execute_process(
36+
COMMAND "build/get_gn"
37+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
38+
RESULT_VARIABLE get_gn_result
39+
)
40+
if(NOT ${get_gn_result} EQUAL 0)
41+
message(FATAL_ERROR "cannot update GN build tool")
42+
endif()
43+
3444
message(STATUS "Configuring WebRTC build system")
3545
execute_process(
3646
COMMAND "build/prepare_webrtc_build" "${CMAKE_CURRENT_BINARY_DIR}/ninja"

webrtc/build/get_gn

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
rootdir="$(cd "$(dirname "$0")"; pwd)"
4+
cd "$rootdir"
5+
6+
if ! webrtc/src/buildtools/linux64/gn --help &>/dev/null
7+
then
8+
# cd "$rootdir/webrtc"
9+
# download_from_google_storage --no_resume --platform='linux*' --no_auth --bucket chromium-gn -s src/buildtools/linux64/gn.sha1
10+
if [ ! -d gn ]
11+
then
12+
git clone https://gn.googlesource.com/gn
13+
fi
14+
cd gn
15+
CC=gcc CXX=g++ LDFLAGS=-fuse-ld=gold python build/gen.py
16+
ninja -C out
17+
cp out/gn ../webrtc/src/buildtools/linux64
18+
fi
19+

webrtc/build/get_webrtc_source

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ then
1010
cd "$rootdir/webrtc"
1111
fetch --nohooks webrtc
1212
gclient sync --nohooks --revision "$revision"
13-
download_from_google_storage --no_resume --platform='linux*' --no_auth --bucket chromium-gn -s src/buildtools/linux64/gn.sha1
1413
elif [ "$run_updates" -eq 1 ]
1514
then
1615
cd "$rootdir/webrtc"
1716
gclient sync --nohooks --revision "$revision"
18-
download_from_google_storage --no_resume --platform='linux*' --no_auth --bucket chromium-gn -s src/buildtools/linux64/gn.sha1
1917
fi
20-

webrtc/build/prepare_webrtc_build

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ set -e
33
rootdir="$(cd "$(dirname "$0")"; pwd)"
44
export PATH="$rootdir/depot_tools:$PATH"
55

6+
THIS_ARCH="$(dpkg-architecture -qDEB_TARGET_ARCH || uname -m)"
7+
case "$THIS_ARCH" in
8+
i?86)
9+
THIS_ARCH=x86
10+
;;
11+
x86_64|amd64)
12+
THIS_ARCH=x64
13+
;;
14+
*)
15+
echo>&2 "Unknown target platform: $THIS_ARCH"
16+
exit 1
17+
;;
18+
esac
19+
620
cd "$rootdir/webrtc/src"
7-
gn gen "$1" --args='is_debug=false is_clang=false is_desktop_linux=false treat_warnings_as_errors=false fatal_linker_warnings=false use_gconf=false use_gio=false use_rtti=true linux_use_bundled_binutils=false use_sysroot=false'
21+
gn gen "$1" --args='is_debug=false is_clang=false is_desktop_linux=false is_android=false treat_warnings_as_errors=false fatal_linker_warnings=false use_gconf=false use_gio=false use_rtti=true linux_use_bundled_binutils=false rtc_enable_protobuf=false rtc_include_tests=false use_sysroot=false current_cpu="'$THIS_ARCH'" target_cpu="'$THIS_ARCH'"'
822

webrtc/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<buildtool_depend>git</buildtool_depend>
1717
<buildtool_depend>ninja-build</buildtool_depend>
1818
<buildtool_depend>cmake</buildtool_depend>
19+
<depend>gtk2</depend>
1920
<depend>gtk3</depend>
2021
<depend>libasound2-dev</depend>
2122
<depend>libglib-dev</depend>

0 commit comments

Comments
 (0)