Skip to content

Commit 86397f4

Browse files
committed
Build should be faster
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
1 parent d1722c6 commit 86397f4

5 files changed

Lines changed: 17 additions & 33 deletions

File tree

webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -193,52 +193,47 @@ set(ENV{PATH} "${WEBRTC_SRC_DIR}/depot_tools${PATH_SEP}$ENV{PATH}")
193193

194194
file(MAKE_DIRECTORY ${WEBRTC_DIR})
195195

196-
message(STATUS "WebRTC: fetch")
196+
message(STATUS "WebRTC: Configuring gclient for branch ${WEBRTC_BRANCH}")
197+
197198
execute_command(
198-
COMMAND fetch --nohooks --no-history webrtc
199+
COMMAND gclient config --name src --unmanaged "https://webrtc.googlesource.com/src.git@${WEBRTC_BRANCH}"
199200
WORKING_DIRECTORY "${WEBRTC_DIR}"
200201
)
201202

202-
message(STATUS "WebRTC: checkout \"${WEBRTC_BRANCH}\"")
203-
execute_command(
204-
COMMAND git checkout .
205-
WORKING_DIRECTORY "${WEBRTC_SRC}"
206-
)
203+
if(APPLE)
204+
set(WEBRTC_TARGET_OS "['mac']")
205+
elseif(WIN32)
206+
set(WEBRTC_TARGET_OS "['win']")
207+
else()
208+
set(WEBRTC_TARGET_OS "['linux']")
209+
endif()
207210

208-
message(STATUS "WebRTC: fetching specific branch ${WEBRTC_BRANCH}")
209-
execute_command(
210-
COMMAND git fetch origin ${WEBRTC_BRANCH}:${WEBRTC_BRANCH}
211-
WORKING_DIRECTORY "${WEBRTC_SRC}"
212-
)
211+
file(APPEND "${WEBRTC_DIR}/.gclient" "target_os = ${WEBRTC_TARGET_OS}\n")
213212

214-
message(STATUS "WebRTC: checkout to ${WEBRTC_BRANCH}")
213+
message(STATUS "WebRTC: Syncing Sources (No Hooks, Shallow)")
215214
execute_command(
216-
COMMAND git checkout ${WEBRTC_BRANCH}
217-
WORKING_DIRECTORY "${WEBRTC_SRC}"
215+
COMMAND gclient sync -D --no-history --nohooks -j16
216+
WORKING_DIRECTORY "${WEBRTC_DIR}"
218217
)
219218

220-
message(STATUS "WebRTC: Patching DEPS to skip download of test resources")
219+
message(STATUS "WebRTC: Patching DEPS")
221220
set(DEPS_FILE "${WEBRTC_SRC}/DEPS")
222-
223221
if(EXISTS "${DEPS_FILE}")
224222
file(READ "${DEPS_FILE}" DEPS_CONTENT)
225-
226223
string(REPLACE
227224
"'src/resources'],"
228225
"'src/resources'], 'condition': 'False',"
229226
DEPS_CONTENT
230227
"${DEPS_CONTENT}"
231228
)
232-
233229
file(WRITE "${DEPS_FILE}" "${DEPS_CONTENT}")
234230
else()
235231
message(WARNING "WebRTC: DEPS file not found. Optimization skipped.")
236232
endif()
237233

238-
239-
message(STATUS "WebRTC: sync")
234+
message(STATUS "WebRTC: Final Sync (Artifacts)")
240235
execute_command(
241-
COMMAND gclient sync -D --no-history -j8
236+
COMMAND gclient sync -D --no-history -j16
242237
WORKING_DIRECTORY "${WEBRTC_DIR}"
243238
)
244239

@@ -299,7 +294,6 @@ rtc_enable_protobuf=false \
299294
rtc_include_tests=false \
300295
rtc_include_dav1d_in_internal_decoder_factory=false \
301296
rtc_enable_google_benchmarks=false \
302-
rtc_video_psnr=false \
303297
use_rtti=true \
304298
symbol_level=0 \
305299
use_dbus=false \

webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/.gitkeep

Whitespace-only changes.

webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/stack_copier_signal.patch

Lines changed: 0 additions & 10 deletions
This file was deleted.

webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/.gitkeep

Whitespace-only changes.

webrtc-jni/src/main/cpp/dependencies/webrtc/patches/windows/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)