Skip to content

Commit

Permalink
feat: Update CEF to 117 (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Nov 27, 2023
1 parent b44cf0b commit f561c94
Show file tree
Hide file tree
Showing 31 changed files with 79 additions and 804 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/linux-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ jobs:
libpostproc-dev \
libswresample-dev
- name: Extract docker dependencies
run: |
./tools/linux/ensure-base-images
sudo ./tools/linux/extract-deps-from-docker
env:
CI: 1

- name: Run build
run: |
Expand Down
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ _Note: if you ran docker with sudo, CasparCG server will not be able to run with
2. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
3. `cd casparcg-server-master`
4. Install dependencies, this can be done with `sudo ./tools/linux/install-dependencies`
5. Extract Boost, FFmpeg and CEF from the docker images via `sudo ./tools/linux/extract-deps-from-docker`. Alternatively these can be prepared manually by following the steps laid out in each Dockerfile
5. Extract Boost and FFmpeg from the docker images via `sudo ./tools/linux/extract-deps-from-docker`. Alternatively these can be prepared manually by following the steps laid out in each Dockerfile
6. `mkdir build && cd build`
7. `cmake ../src`
8. `make -j8`
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SET (CONFIG_VERSION_TAG "Dev")
option(ENABLE_HTML "Enable HTML module, require CEF" ON)

# Add custom cmake modules path
SET (CASPARCG_PATCH_DIR ${CMAKE_SOURCE_DIR}/CMakeModules/patches)
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)

# Determine the git hash
Expand Down
32 changes: 26 additions & 6 deletions src/CMakeModules/Bootstrap_Linux.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required (VERSION 3.16)

include(ExternalProject)

# Determine build (target) platform
SET (PLATFORM_FOLDER_NAME "linux")

Expand Down Expand Up @@ -35,8 +37,30 @@ FIND_PACKAGE (SFML 2 COMPONENTS graphics window system REQUIRED)
FIND_PACKAGE (X11 REQUIRED)

if (ENABLE_HTML)
SET(CEF_ROOT_DIR "/opt/cef" CACHE STRING "Path to CEF")
FIND_PACKAGE (CEF REQUIRED)
casparcg_add_external_project(cef)
ExternalProject_Add(cef
URL https://cef-builds.spotifycdn.com/cef_binary_117.2.5%2Bgda4c36a%2Bchromium-117.0.5938.152_linux64_minimal.tar.bz2
URL_HASH SHA1=7e6c9cf591cf3b1dabe65a7611f5fc166df2ec1e
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CMAKE_ARGS -DUSE_SANDBOX=Off
INSTALL_COMMAND ""
PATCH_COMMAND git apply ${CASPARCG_PATCH_DIR}/cef117.patch
BUILD_BYPRODUCTS
"<SOURCE_DIR>/Release/libcef.so"
"<BINARY_DIR>/libcef_dll_wrapper/libcef_dll_wrapper.a"
)
ExternalProject_Get_Property(cef SOURCE_DIR)
ExternalProject_Get_Property(cef BINARY_DIR)

# Note: All of these must be referenced in the BUILD_BYPRODUCTS above, to satisfy ninja
set(CEF_LIB
"${SOURCE_DIR}/Release/libcef.so"
"${BINARY_DIR}/libcef_dll_wrapper/libcef_dll_wrapper.a"
)

set(CEF_INCLUDE_PATH "${SOURCE_DIR}")
set(CEF_BIN_PATH "${SOURCE_DIR}/Release")
set(CEF_RESOURCE_PATH "${SOURCE_DIR}/Resources")
endif ()

SET (BOOST_INCLUDE_PATH "${Boost_INCLUDE_DIRS}")
Expand All @@ -46,10 +70,6 @@ SET (SFML_INCLUDE_PATH "${SFML_INCLUDE_DIR}")
SET (FFMPEG_INCLUDE_PATH "${FFMPEG_INCLUDE_DIRS}")
SET (FREEIMAGE_INCLUDE_PATH "${FreeImage_INCLUDE_DIRS}")

set(CEF_INCLUDE_PATH "${CEF_ROOT_DIR}")
set(CEF_BIN_PATH "${CEF_ROOT_DIR}/Release")
set(CEF_RESOURCE_PATH "${CEF_ROOT_DIR}/Resources")

SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)

ADD_DEFINITIONS (-DSFML_STATIC)
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeModules/Bootstrap_Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ casparcg_add_runtime_dependency("${LIBERATION_FONTS_BIN_PATH}/LiberationMono-Reg
if (ENABLE_HTML)
casparcg_add_external_project(cef)
ExternalProject_Add(cef
URL ${CASPARCG_DOWNLOAD_MIRROR}/cef/cef_binary_4638_windows_x64.zip
URL_HASH MD5=14ad547122903eba3f145322fb02bc6d
URL https://cef-builds.spotifycdn.com/cef_binary_117.2.5%2Bgda4c36a%2Bchromium-117.0.5938.152_windows64_minimal.tar.bz2
URL_HASH MD5=cff21bce81bada2a9e5f0afbec0858f0
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
CMAKE_ARGS -DUSE_SANDBOX=Off -DCEF_RUNTIME_LIBRARY_FLAG=/MD
INSTALL_COMMAND ""
PATCH_COMMAND git apply ${CASPARCG_PATCH_DIR}/cef117.patch
)
ExternalProject_Get_Property(cef SOURCE_DIR)
ExternalProject_Get_Property(cef BINARY_DIR)
Expand All @@ -223,8 +224,7 @@ if (ENABLE_HTML)
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/chrome_200_percent.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/resources.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/icudtl.dat")

casparcg_add_runtime_dependency_dir("${CEF_BIN_PATH}/swiftshader")

casparcg_add_runtime_dependency("${CEF_BIN_PATH}/snapshot_blob.bin")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/v8_context_snapshot.bin")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libcef.dll")
Expand Down
69 changes: 0 additions & 69 deletions src/CMakeModules/FindCEF.cmake

This file was deleted.

16 changes: 16 additions & 0 deletions src/CMakeModules/patches/cef117.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -132,11 +132,8 @@
# Global setup.
#

-# For VS2022 and Xcode 12+ support.
-cmake_minimum_required(VERSION 3.21)
-
-# Only generate Debug and Release configuration types.
-set(CMAKE_CONFIGURATION_TYPES Debug Release)
+# VS2022 and Xcode 12+ support needs 3.21, but ubuntu22.04 ships with 3.20
+cmake_minimum_required(VERSION 3.20)

# Project name.
# TODO: Change this line to match your project name when you copy this file.
15 changes: 0 additions & 15 deletions src/accelerator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ set(SOURCES

accelerator.cpp
)
if (MSVC)
list(APPEND SOURCES
d3d/d3d_device.cpp
d3d/d3d_device_context.cpp
d3d/d3d_texture2d.cpp
)
endif ()
set(HEADERS
ogl/image/image_kernel.h
ogl/image/image_mixer.h
Expand All @@ -36,13 +29,6 @@ set(HEADERS
accelerator.h
StdAfx.h
)
if (MSVC)
list(APPEND HEADERS
d3d/d3d_device.h
d3d/d3d_device_context.h
d3d/d3d_texture2d.h
)
endif ()

bin2c("ogl/image/shader.vert" "ogl_image_vertex.h" "caspar::accelerator::ogl" "vertex_shader")
bin2c("ogl/image/shader.frag" "ogl_image_fragment.h" "caspar::accelerator::ogl" "fragment_shader")
Expand All @@ -61,6 +47,5 @@ source_group(sources\\cpu\\image cpu/image/.*)
source_group(sources\\cpu\\util cpu/util/.*)
source_group(sources\\ogl\\image ogl/image/.*)
source_group(sources\\ogl\\util ogl/util/.*)
source_group(sources\\d3d d3d/.*)

target_link_libraries(accelerator common core)

0 comments on commit f561c94

Please sign in to comment.