Add WEBRTC_REVISION variable, fetch the release branch head by default

This commit is contained in:
Axel Isouard 2017-02-21 19:51:37 +01:00
parent 83814ef6f3
commit b668195218
No known key found for this signature in database
GPG key ID: 4E64BB3EAAF31C29
3 changed files with 39 additions and 9 deletions

View file

@ -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)
@ -32,4 +33,4 @@ foreach(p LIB BIN INCLUDE CMAKE)
if(NOT IS_ABSOLUTE "${${var}}") if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif() endif()
endforeach() endforeach()

View file

@ -5,9 +5,9 @@ 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}")
set(LIBWEBRTC_VERSION set(LIBWEBRTC_VERSION
${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION}) ${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION})

View file

@ -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
@ -170,4 +199,4 @@ ExternalProject_Add(
) )
include(Install) include(Install)
include(Package) include(Package)