mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 11:15:13 +00:00
Add WEBRTC_REVISION variable, fetch the release branch head by default
This commit is contained in:
parent
83814ef6f3
commit
b668195218
3 changed files with 39 additions and 9 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
option(BUILD_TESTS "Build test binaries" OFF)
|
option(BUILD_TESTS "Build test binaries" OFF)
|
||||||
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC")
|
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC")
|
||||||
option(BUILD_SHARED_LIB "Build WebRTC as a shared library." OFF)
|
option(BUILD_SHARED_LIB "Build WebRTC as a shared library." OFF)
|
||||||
|
set(WEBRTC_REVISION "" CACHE STRING "WebRTC commit hash to checkout")
|
||||||
|
|
||||||
if(BUILD_SHARED_LIB)
|
if(BUILD_SHARED_LIB)
|
||||||
set(LIBRARY_TYPE SHARED)
|
set(LIBRARY_TYPE SHARED)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ set(LIBWEBRTC_MAJOR_VERSION 0)
|
||||||
set(LIBWEBRTC_MINOR_VERSION 0)
|
set(LIBWEBRTC_MINOR_VERSION 0)
|
||||||
set(LIBWEBRTC_PATCH_VERSION 1)
|
set(LIBWEBRTC_PATCH_VERSION 1)
|
||||||
set(LIBWEBRTC_BUILD_VERSION -rc.4)
|
set(LIBWEBRTC_BUILD_VERSION -rc.4)
|
||||||
set(LIBWEBRTC_WEBRTC_REVISION ae2551232b5249e38298a50f2d9a64d3c862db00)
|
set(LIBWEBRTC_WEBRTC_HEAD refs/branch-heads/57)
|
||||||
|
|
||||||
set(LIBWEBRTC_API_VERSION
|
set(LIBWEBRTC_API_VERSION
|
||||||
"${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}")
|
"${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}")
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@ include(ExternalProject)
|
||||||
include(LibWebRTCCommand)
|
include(LibWebRTCCommand)
|
||||||
include(GClientConfig)
|
include(GClientConfig)
|
||||||
|
|
||||||
set(_DOWNLOAD_COMMAND ${GCLIENT_EXECUTABLE} sync --revision
|
set(_DOWNLOAD_COMMAND ${GCLIENT_EXECUTABLE} sync --with_branch_heads --nohooks)
|
||||||
${LIBWEBRTC_WEBRTC_REVISION} -D -n)
|
if (WEBRTC_REVISION)
|
||||||
set(_BUILD_COMMAND ${PYTHON_EXECUTABLE} src/tools/clang/scripts/update.py)
|
set(_DOWNLOAD_COMMAND --revision ${WEBRTC_REVISION})
|
||||||
|
endif (WEBRTC_REVISION)
|
||||||
|
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
webrtc-src
|
webrtc-src
|
||||||
|
|
@ -14,11 +15,39 @@ ExternalProject_Add(
|
||||||
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
|
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
|
||||||
|
|
||||||
DOWNLOAD_COMMAND ${PREFIX_EXECUTE} ${_DOWNLOAD_COMMAND}
|
DOWNLOAD_COMMAND ${PREFIX_EXECUTE} ${_DOWNLOAD_COMMAND}
|
||||||
BUILD_COMMAND ${PREFIX_EXECUTE} ${_BUILD_COMMAND}
|
BUILD_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
)
|
)
|
||||||
|
|
||||||
set(_NEXT_DEPENDS webrtc-src)
|
if (NOT WEBRTC_REVISION)
|
||||||
|
libwebrtc_command(
|
||||||
|
NAME webrtc-fetch-refs
|
||||||
|
COMMAND ${GIT_EXECUTABLE} fetch origin ${LIBWEBRTC_WEBRTC_HEAD}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src"
|
||||||
|
COMMENT "Fetching branch heads"
|
||||||
|
DEPENDS webrtc-src
|
||||||
|
)
|
||||||
|
|
||||||
|
libwebrtc_command(
|
||||||
|
NAME webrtc-checkout-fetch-head
|
||||||
|
COMMAND ${GIT_EXECUTABLE} checkout FETCH_HEAD
|
||||||
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src"
|
||||||
|
COMMENT "Checking out fetch head"
|
||||||
|
DEPENDS webrtc-fetch-refs
|
||||||
|
)
|
||||||
|
|
||||||
|
set(_NEXT_DEPENDS webrtc-checkout-fetch-head)
|
||||||
|
endif (NOT WEBRTC_REVISION)
|
||||||
|
|
||||||
|
libwebrtc_command(
|
||||||
|
NAME webrtc-update-clang
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} src/tools/clang/scripts/update.py
|
||||||
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
|
COMMENT "Updating clang"
|
||||||
|
DEPENDS ${_NEXT_DEPENDS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(_NEXT_DEPENDS webrtc-update-clang)
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
libwebrtc_command(
|
libwebrtc_command(
|
||||||
NAME webrtc-install-sysroot
|
NAME webrtc-install-sysroot
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue